Added forgotten -section argument
authorEd Bartosh <eduard.bartosh@intel.com>
Sun, 8 Dec 2013 21:37:19 +0000 (23:37 +0200)
committerEduard Bartosh <eduard.bartosh@intel.com>
Tue, 10 Dec 2013 09:47:56 +0000 (11:47 +0200)
-section argument must be added again when parser is re-created.
Otherwise it will not be shown in --help output.

Change-Id: I01f96e6a9fd4730dc839d11b1d2482f2973d119c
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/8384
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
repa/main.py

index b1497ff189552774318da0ced25735bab01dd006..d926ea28d2b179dc3a86c6279647d2d23871b47c 100755 (executable)
@@ -46,8 +46,7 @@ def parse_args(argv):
     """
     # create parser to parse -section
     parser = ArgumentParser(add_help=False)
-    parser.add_argument('-section', default='general',
-                        help='config section to use')
+    parser.add_argument('-section', default='general')
 
     # read config section, specified in command line
     parsed, argv = parser.parse_known_args(argv)
@@ -55,6 +54,8 @@ def parse_args(argv):
 
     # recreate parser to parse rest of the command line
     parser = ArgumentParser(description='Release Engineering Process Assistant')
+    parser.add_argument('-section', default='general',
+                        help='config section to use')
     # Define subcommands using setup.py entry points
     subparsers = parser.add_subparsers(help='sub-command help')
     for entry in pkg_resources.iter_entry_points(group='repa_commands'):