Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion b2/_internal/console_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
1 change: 1 addition & 0 deletions changelog.d/+version-command-b2sdk.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update the ``version`` command to display the installed ``b2sdk`` version alongside the CLI version.
6 changes: 5 additions & 1 deletion test/unit/test_console_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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',
)
Loading