Fail early when no command given

This commit is contained in:
Ian Wienand 2018-06-01 15:46:56 +10:00
parent 5bc5403d6d
commit 9d29fbb8b7

View File

@ -106,6 +106,10 @@ class AFSMonCmd(object):
logging.basicConfig(level=logging.DEBUG) logging.basicConfig(level=logging.DEBUG)
logger.debug("Debugging enabled") logger.debug("Debugging enabled")
if not self.args.command:
parser.print_help()
return 1
if not os.path.exists(self.args.config): if not os.path.exists(self.args.config):
raise ValueError("Config file %s does not exist" % raise ValueError("Config file %s does not exist" %
self.args.config) self.args.config)