From af728b3dd8c6145c9a85b67f0599050657338a79 Mon Sep 17 00:00:00 2001 From: Charlie Drage Date: Tue, 30 Aug 2016 15:01:45 -0400 Subject: [PATCH] Fixes mode argument with --mode=genanswers When `sudo atomic run projectatomic/helloapache --mode=genanswers` is supplied, the resulting error shows that `--mode=genanswers` is an unrecognized argument. This was introduced after refactoring the cli/main.py code to NOT include uneeded parameters such as --provider-auth to CLI options such as init and genanswers. By moving the --mode parser to the globals_parser, each command will have the --mode option available. Fixes https://github.com/projectatomic/atomicapp/issues/792 --- atomicapp/cli/main.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/atomicapp/cli/main.py b/atomicapp/cli/main.py index 1bb3b706..9d1a9840 100644 --- a/atomicapp/cli/main.py +++ b/atomicapp/cli/main.py @@ -232,12 +232,7 @@ def create_parser(self): none: atomicapp will disable any logging. If nothing is set and logging to file then 'nocolor' by default. If nothing is set and logging to tty then 'color' by default.""") - - # === DEPLOY PARSER === - # Create a 'deploy parser' that will include flags related to deploying - # and answers files - deploy_parser = argparse.ArgumentParser(add_help=False) - deploy_parser.add_argument( + globals_parser.add_argument( "--mode", dest="mode", default=None, @@ -249,6 +244,11 @@ def create_parser(self): in cases where a user is not using the Atomic App cli directly, but through another interface such as the Atomic CLI. EX: `atomic run --mode=genanswers`''')) + + # === DEPLOY PARSER === + # Create a 'deploy parser' that will include flags related to deploying + # and answers files + deploy_parser = argparse.ArgumentParser(add_help=False) deploy_parser.add_argument( "--dry-run", dest="dryrun",