diff --git a/gp2040ce_bintools/__init__.py b/gp2040ce_bintools/__init__.py index df5cd18..1a20da0 100644 --- a/gp2040ce_bintools/__init__.py +++ b/gp2040ce_bintools/__init__.py @@ -33,7 +33,8 @@ logger = logging.getLogger(__name__) # parse flags that are common to many tools (e.g. adding paths for finding .proto files) core_parser = argparse.ArgumentParser(add_help=False) -core_parser.add_argument('-v', '--version', action='version', version=f"%(prog)s {__version__}", +core_parser.add_argument('-v', '--version', action='version', + version=f"gp2040ce-binary-tools {__version__} (Python {sys.version})", help="show version information and exit") core_parser.add_argument('-d', '--debug', action='store_true', help="enable debug logging") core_parser.add_argument('-P', '--proto-files-path', type=pathlib.Path, default=list(), action='append', diff --git a/tests/test_commands.py b/tests/test_commands.py index 6671ec4..f177266 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -30,7 +30,8 @@ def with_pb2s(test, *args, **kwargs): def test_version_flag(): """Test that tools report the version.""" result = run(['visualize-config', '-v'], capture_output=True, encoding='utf8') - assert __version__ in result.stdout + assert f'gp2040ce-binary-tools {__version__}' in result.stdout + assert 'Python 3' in result.stdout def test_help_flag():