[Piglit] [PATCH 4/4] framework: reduce code ducplication in run parser

Dylan Baker baker.dylan.c at gmail.com
Thu Aug 6 14:43:09 PDT 2015


Make use the of the ArgumentParser prototype provided by
framework/programs/parsers.py, and used in the summary aggregate parser
already.

Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
 framework/programs/run.py | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/framework/programs/run.py b/framework/programs/run.py
index a4fb820..bf8cc10 100644
--- a/framework/programs/run.py
+++ b/framework/programs/run.py
@@ -90,7 +90,8 @@ def _run_parser(input_):
     """ Parser for piglit run command """
     unparsed = parsers.parse_config(input_)[1]
 
-    parser = argparse.ArgumentParser()
+    # Set the parent of the config to add the -f/--config message
+    parser = argparse.ArgumentParser(parents=[parsers.CONFIG])
     parser.add_argument("-n", "--name",
                         metavar="<test name>",
                         default=None,
@@ -146,12 +147,6 @@ def _run_parser(input_):
                         type=str,
                         default="",
                         help="suffix string to append to each test name in junit")
-    # -f/--config is a duplicate that cannot be hit, but is needed for help
-    # generation
-    parser.add_argument("-f", "--config",
-                        metavar="config_file",
-                        dest="__unused",
-                        help="override piglit.conf search path")
     log_parser = parser.add_mutually_exclusive_group()
     log_parser.add_argument('-v', '--verbose',
                             action='store_const',
-- 
2.5.0



More information about the Piglit mailing list