From 3c43263bb9b8912c05593bd4a0345192079e9300 Mon Sep 17 00:00:00 2001 From: gryf Date: Thu, 19 Aug 2021 20:14:04 +0200 Subject: [PATCH] Fix clashing version from boxpy and subcommands. Currently, you could pass long version of '--version' option to either boxpy itself and subcommands create and rebuild. With this patch proper context is now detected. --- box.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/box.py b/box.py index 37d59f2..a693823 100755 --- a/box.py +++ b/box.py @@ -1398,7 +1398,7 @@ def main(): LOG.set_verbose(args.verbose, args.quiet) - if args.version: + if not getattr(args, 'func') and args.version: LOG.info(f'boxpy {__version__}') parser.exit()