Add help screen

This commit is contained in:
Joseph Hall 2015-06-29 12:25:38 -06:00
parent 695d8f0e9d
commit 750e206178

View File

@ -2608,6 +2608,9 @@ class SPMParser(six.with_metaclass(OptionParserMeta,
'''
The cli parser object used to fire up the salt spm system.
'''
description = 'SPM is used to manage 3rd party formulas and other Salt components'
usage = '%prog [options] <function> [arguments]'
# ConfigDirMixIn config filename attribute
_config_filename_ = 'spm'
@ -2628,5 +2631,11 @@ class SPMParser(six.with_metaclass(OptionParserMeta,
help='Default yes in answer to all confirmation questions.'
)
def _mixin_after_parsed(self):
# spm needs arguments
if len(self.args) <= 1:
self.print_help()
self.exit(salt.defaults.exitcodes.EX_USAGE)
def setup_config(self):
return salt.config.spm_config(self.get_config_file_path())