Commits

Ian Bicking  committed e221098

Add --provider and --yes arguments to each subcommand, so they can be anywhere on the command line

  • Participants
  • Parent commits 36b86c3
  • Branches trunk

Comments (0)

Files changed (1)

File silverlining/runner.py

     'run', help="Run a command on a remote host")
 
 parser_run_mock.add_argument(
-    '-p', '--provider',
-    metavar='NAME',
-    help="The [provider:NAME] section from ~/.silverlining.conf to use (default [provider:default])",
-    default="default")
-
-parser_run_mock.add_argument(
-    '-y', '--yes',
-    action='store_true',
-    help="Answer yes to any questions")
-
-#add_verbose(parser_run, add_log=True)
-
-parser_run_mock.add_argument(
     'host',
     help="Host where the application is running")
 
     '--instance-name', metavar='APP_NAME.DATE_VERSION',
     help="Diff with a specific instance (not the active one)")
 
+
+for subparser in subcommands._name_parser_map.values():
+    ## FIXME: these options should also be available in the subparsers:
+    subparser.add_argument(
+        '-p', '--provider',
+        metavar='NAME',
+        help="The [provider:NAME] section from ~/.silverlining.conf to use (default [provider:default])",
+        default="default")
+
+    subparser.add_argument(
+        '-y', '--yes',
+        action='store_true',
+        help="Answer yes to any questions")
+
+    add_verbose(subparser, add_log=True)
+
+
 def catch_error(func):
     """Catch CommandError and turn it into an error message"""
     def decorated(*args, **kw):