From 9d29fbb8b7b83fe6bb31d758f2b4cacd154fde17 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Fri, 1 Jun 2018 15:46:56 +1000 Subject: [PATCH] Fail early when no command given --- afsmon/cmd/main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/afsmon/cmd/main.py b/afsmon/cmd/main.py index bd1155f..6cc502a 100644 --- a/afsmon/cmd/main.py +++ b/afsmon/cmd/main.py @@ -106,6 +106,10 @@ class AFSMonCmd(object): logging.basicConfig(level=logging.DEBUG) logger.debug("Debugging enabled") + if not self.args.command: + parser.print_help() + return 1 + if not os.path.exists(self.args.config): raise ValueError("Config file %s does not exist" % self.args.config)