diff --git a/b2/_internal/console_tool.py b/b2/_internal/console_tool.py index d14f9834f..ddce9c6ae 100644 --- a/b2/_internal/console_tool.py +++ b/b2/_internal/console_tool.py @@ -4261,7 +4261,9 @@ def _run(self, args): if args.short: self._print(VERSION) else: - self._print('b2 command line tool, version', VERSION) + self._print( + 'b2 command line tool, version', VERSION, '(b2sdk version', b2sdk_version + ')' + ) return 0 diff --git a/changelog.d/+version-command-b2sdk.changed.md b/changelog.d/+version-command-b2sdk.changed.md new file mode 100644 index 000000000..e5e636529 --- /dev/null +++ b/changelog.d/+version-command-b2sdk.changed.md @@ -0,0 +1 @@ +Update the ``version`` command to display the installed ``b2sdk`` version alongside the CLI version. diff --git a/test/unit/test_console_tool.py b/test/unit/test_console_tool.py index e113fe002..e0311f41c 100644 --- a/test/unit/test_console_tool.py +++ b/test/unit/test_console_tool.py @@ -32,6 +32,7 @@ fix_windows_path_limit, ) from b2sdk.v3.exception import Conflict # Any error for testing fast-fail of the rm command. +from b2sdk.version import VERSION as b2sdk_version from more_itertools import one from b2._internal._cli.const import ( @@ -3759,4 +3760,7 @@ def test_rm_filters_mixed(self): class TestVersionConsoleTool(BaseConsoleToolTest): def test_version(self): self._run_command(['version', '--short'], expected_stdout=f'{VERSION}\n') - self._run_command(['version'], expected_stdout=f'b2 command line tool, version {VERSION}\n') + self._run_command( + ['version'], + expected_stdout=f'b2 command line tool, version {VERSION} (b2sdk version {b2sdk_version})\n', + )