Bug 1221187: testing/marionette/client: Explicitly define --version flag
Passing the version keyword to argparse's constructor implicitly adds
-v and --version flags that conflicts with the -v/--verbose flag that
is added in BaseMarionetteArguments.
This removes -v as an alias to --version, which unbreaks testing on try
because it uses runtests.py.
It's perhaps worth mentioning that try uses runtests.py because it does
not (yet) have a full checkout of the source when it runs the tests.
r=dburns
--- a/testing/marionette/client/marionette/runtests.py
+++ b/testing/marionette/client/marionette/runtests.py
@@ -33,26 +33,26 @@ class MarionetteHarness(object):
runner_class=MarionetteTestRunner,
parser_class=MarionetteArguments,
args=None):
self._runner_class = runner_class
self._parser_class = parser_class
self.args = args or self.parse_args()
def parse_args(self, logger_defaults=None):
- parser = self._parser_class(
- usage='%(prog)s [options] test_file_or_dir <test_file_or_dir> ...',
+ parser = self._parser_class(usage='%(prog)s [options] test_file_or_dir <test_file_or_dir> ...')
+ parser.add_argument('--version', action='version',
+ help="Show version information.",
version="%(prog)s {version}"
" (using marionette-driver: {driver_version}, "
"marionette-transport: {transport_version})".format(
version=__version__,
driver_version=driver_version,
transport_version=transport_version
- )
- )
+ ))
mozlog.commandline.add_logging_group(parser)
args = parser.parse_args()
parser.verify_usage(args)
logger = mozlog.commandline.setup_logging(
args.logger_name, args, logger_defaults or {"tbpl": sys.stdout})
args.logger = logger