summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Ivanov <KEIvanov@gmail.com>2022-05-05 19:33:26 +0300
committerKonstantin Ivanov <KEIvanov@gmail.com>2022-05-05 19:33:26 +0300
commitbf10d0e7adc88ed65dd482ca63bae37d9f0f34c8 (patch)
tree1ed22dc4b3f8d62795824ba1054640c4819283e7
parent2ef6d420186c0d0effdb6795215e121474b2dfc9 (diff)
add --version option
refactor: add bt_dualboot.__meta__ module
-rw-r--r--bt_dualboot/__init__.py5
-rw-r--r--bt_dualboot/__meta__.py6
-rw-r--r--bt_dualboot/cli/app.py12
-rwxr-xr-xdev/pre-release/update-version45
-rw-r--r--pyproject.toml3
-rw-r--r--tests/cli/tools_test.py16
-rw-r--r--tests_integration/cli/env_blank_linux/snapshots/test_cli/test_no_args/output9
-rw-r--r--tests_integration/cli/env_blank_linux/snapshots/test_cli/test_version/output12
-rw-r--r--tests_integration/cli/env_blank_linux/test_cli.py8
-rw-r--r--tests_integration/cli/env_single_windows/snapshots/test_cli/TestSync/test_missing_mac/output6
-rw-r--r--tests_integration/cli/env_single_windows/snapshots/test_cli/TestSync/test_require_backup/output6
-rw-r--r--tests_integration/cli/env_single_windows/snapshots/test_cli/TestSync/test_wrong_separator/output6
-rw-r--r--tests_integration/cli/env_single_windows/snapshots/test_cli/TestSyncAll/test_require_backup/output6
-rw-r--r--tests_integration/cli/env_single_windows/snapshots/test_cli/TestSyncAll/test_sync_all_and_sync/output6
-rw-r--r--tests_integration/cli/env_single_windows/snapshots/test_cli/TestSyncAllDryRun/test_require_backup/output6
-rw-r--r--tests_integration/cli/env_single_windows/snapshots/test_cli/TestSyncAllDryRun/test_sync_all_and_sync/output6
-rw-r--r--tests_integration/cli/env_single_windows/snapshots/test_cli/TestSyncDryRun/test_missing_mac/output6
-rw-r--r--tests_integration/cli/env_single_windows/snapshots/test_cli/TestSyncDryRun/test_require_backup/output6
-rw-r--r--tests_integration/cli/env_single_windows/snapshots/test_cli/TestSyncDryRun/test_wrong_separator/output6
-rw-r--r--tests_integration/cli/env_single_windows/snapshots/test_cli/test_backup_without_sync/output6
-rw-r--r--tests_integration/cli/env_single_windows/snapshots/test_cli/test_no_args/output9
-rw-r--r--tests_integration/cli/env_single_windows/snapshots/test_cli/test_no_args_but_win/output6
-rw-r--r--tests_integration/cli/env_single_windows/snapshots/test_cli/test_no_backup_and_backup/output6
-rw-r--r--tests_integration/cli/env_single_windows/snapshots/test_cli/test_no_backup_without_sync/output6
-rw-r--r--tests_integration/helpers.py3
25 files changed, 156 insertions, 56 deletions
diff --git a/bt_dualboot/__init__.py b/bt_dualboot/__init__.py
index f102a9c..62ff5a0 100644
--- a/bt_dualboot/__init__.py
+++ b/bt_dualboot/__init__.py
@@ -1 +1,4 @@
-__version__ = "0.0.1"
+# NOTE: re-exported for foreign packages only including tests
+# in order to clean modules dependencies without circular imports
+# submodules of `bt_dualboot.*` should import this from `bt_dualboot.__meta__`
+from .__meta__ import APP_NAME, __version__
diff --git a/bt_dualboot/__meta__.py b/bt_dualboot/__meta__.py
new file mode 100644
index 0000000..e16709d
--- /dev/null
+++ b/bt_dualboot/__meta__.py
@@ -0,0 +1,6 @@
+APP_NAME = "bt-dualboot"
+
+# NOTE: don't edit here
+# version updated by `dev/pre-release/update-version` from `pyproject.toml`
+__version__ = "0.1.3"
+
diff --git a/bt_dualboot/cli/app.py b/bt_dualboot/cli/app.py
index 1506c16..ba5513c 100644
--- a/bt_dualboot/cli/app.py
+++ b/bt_dualboot/cli/app.py
@@ -4,6 +4,7 @@ from argparse import ArgumentParser, ArgumentTypeError
from contextlib import contextmanager
import re
+from bt_dualboot.__meta__ import APP_NAME, __version__
from bt_dualboot.bt_sync_manager import BtSyncManager, DeviceNotFoundError
from bt_dualboot.win_mount import locate_windows_mount_points
from bt_dualboot.windows_registry import WindowsRegistry
@@ -32,8 +33,8 @@ def mac_str(argument_value):
def _argv_parser():
arg_parser = ArgumentParser(
- prog="bt-dualboot",
- description="Sync bluetooth keys from Linux to Windows.",
+ prog=APP_NAME,
+ description=f"Sync bluetooth keys from Linux to Windows (v{__version__})",
)
# fmt: off
@@ -41,6 +42,7 @@ def _argv_parser():
args_sync = arg_parser.add_argument_group("Sync keys")
args_backup = arg_parser.add_argument_group("Backup Windows Registry")
+ arg_parser .add_argument("--version", help=f"print version", action="store_true")
args_list .add_argument("-l", "--list", help="[root required] list bluetooth devices", action="store_true")
args_list .add_argument("--list-win-mounts", help="list mounted Windows locations", action="store_true")
args_list .add_argument("--bot", help="parsable output for robots (supported: -l)", action="store_true")
@@ -271,7 +273,11 @@ def parse_argv():
opts = parser.parse_args()
if is_debug():
- print(opts)
+ print(f"argv: {opts}")
+
+ if opts.version:
+ print(f"{APP_NAME} {__version__}")
+ return
# fmt: off
blank_states = {
diff --git a/dev/pre-release/update-version b/dev/pre-release/update-version
new file mode 100755
index 0000000..9df22b5
--- /dev/null
+++ b/dev/pre-release/update-version
@@ -0,0 +1,45 @@
+#!/usr/bin/env python3
+
+"""
+Update __version__ in bt_dualboot/__meta__.py with value from pyproject.toml
+"""
+
+import os
+import shutil
+from tempfile import TemporaryDirectory
+import re
+
+def pyproject_toml_version():
+ with open("pyproject.toml") as f:
+ for line in f:
+ res = re.match("^version = ['\"](\d+\.\d+\.\d+)['\"]\s*", line)
+
+ if res is not None:
+ return res.groups()[0]
+
+ raise RuntimeError("no version= found in pyproject.toml")
+
+
+def rewrite_version():
+ src_filepath = os.path.join("bt_dualboot", "__meta__.py")
+ version_sting = f'__version__ = "{pyproject_toml_version()}"'
+ with TemporaryDirectory() as temp_dir_name:
+ backup_filepath = os.path.join(temp_dir_name, "orig")
+ shutil.copy(src_filepath, backup_filepath)
+
+ with open(backup_filepath) as f_read:
+ with open(src_filepath, "w") as f_write:
+ for line in f_read:
+ if line.find("__version__") != 0:
+ f_write.write(line)
+ else:
+ print(version_sting, file=f_write)
+
+ print(f"updated '{src_filepath}' with:")
+ print(version_sting)
+
+def main():
+ rewrite_version()
+
+if __name__ == "__main__":
+ main()
diff --git a/pyproject.toml b/pyproject.toml
index 160389a..4b7d35a 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,7 +1,8 @@
[tool.poetry]
name = "bt-dualboot"
-version = "0.1.0"
+version = "0.1.3"
description = "Sync Bluetooth for dualboot Linux and Windows"
+keywords = [ "bluetooth", "dualboot", "sync", "pairing", "keys" ]
authors = ["Konstantin Ivanov <KEIvanov@gmail.com>"]
license = "MIT"
diff --git a/tests/cli/tools_test.py b/tests/cli/tools_test.py
index cabe4fd..2e3d591 100644
--- a/tests/cli/tools_test.py
+++ b/tests/cli/tools_test.py
@@ -1,3 +1,5 @@
+import re
+from bt_dualboot import __version__
from bt_dualboot.bluetooth_device import BluetoothDevice
from bt_dualboot.cli.tools import print_devices_list
@@ -13,6 +15,20 @@ def _print_with_common_args(*args, **kwrd):
) # fmt: skip
+def test_version():
+ with open("pyproject.toml") as f:
+ for line in f:
+ res = re.match(r"^version = ['\"](\d+\.\d+\.\d+)['\"]\s*", line)
+
+ if res is not None:
+ pyproject_toml_version = res.groups()[0]
+ assert __version__ == pyproject_toml_version, \
+ "version mismatch between pyproject.toml and bt_dualboot.__version__; invoke dev/pre-release/update-version to fix"
+ return
+
+ assert False, "no version= found in pyproject.toml"
+
+
class Test__print_devices_list:
def test_bot_two_devices(self, capsys):
_print_with_common_args(
diff --git a/tests_integration/cli/env_blank_linux/snapshots/test_cli/test_no_args/output b/tests_integration/cli/env_blank_linux/snapshots/test_cli/test_no_args/output
index 19d36a4..a880265 100644
--- a/tests_integration/cli/env_blank_linux/snapshots/test_cli/test_no_args/output
+++ b/tests_integration/cli/env_blank_linux/snapshots/test_cli/test_no_args/output
@@ -3,14 +3,15 @@ CMD: /src/bt-dualboot
RETCODE=1
STDOUT:
=======
-usage: bt-dualboot [-h] [-l] [--list-win-mounts] [--bot] [--dry-run]
- [--win MOUNT] [--sync MAC [MAC ...]] [--sync-all] [-n]
- [-b [path]]
+usage: bt-dualboot [-h] [--version] [-l] [--list-win-mounts] [--bot]
+ [--dry-run] [--win MOUNT] [--sync MAC [MAC ...]]
+ [--sync-all] [-n] [-b [path]]
-Sync bluetooth keys from Linux to Windows.
+Sync bluetooth keys from Linux to Windows (v0.1.3)
optional arguments:
-h, --help show this help message and exit
+ --version print version
List resources:
-l, --list [root required] list bluetooth devices
diff --git a/tests_integration/cli/env_blank_linux/snapshots/test_cli/test_version/output b/tests_integration/cli/env_blank_linux/snapshots/test_cli/test_version/output
new file mode 100644
index 0000000..271ec88
--- /dev/null
+++ b/tests_integration/cli/env_blank_linux/snapshots/test_cli/test_version/output
@@ -0,0 +1,12 @@
+CONTEXT: [env_blank_linux] chntpw not installed, windows not mounted
+CMD: /src/bt-dualboot --version
+RETCODE=0
+STDOUT:
+=======
+bt-dualboot 0.1.3
+
+-------------------------------------------------------------
+STDERR:
+=======
+
+------------------------------------------------------------- \ No newline at end of file
diff --git a/tests_integration/cli/env_blank_linux/test_cli.py b/tests_integration/cli/env_blank_linux/test_cli.py
index 0049d0a..276c24d 100644
--- a/tests_integration/cli/env_blank_linux/test_cli.py
+++ b/tests_integration/cli/env_blank_linux/test_cli.py
@@ -1,3 +1,4 @@
+from bt_dualboot import APP_NAME, __version__
from tests_integration.helpers import snapshot_cli_result, debug_shell
from operator import itemgetter
@@ -30,6 +31,13 @@ def test_help(snapshot):
snapshot_cli(snapshot, ["-h"])
+def test_version(snapshot):
+ for res in snapshot_cli(snapshot, ["--version"]):
+ retcode, stdout = itemgetter("retcode", "stdout")(res)
+ assert retcode == 0
+ assert stdout == f"{APP_NAME} {__version__}\n"
+
+
def test_list(snapshot):
"""should fails with error about missing `reged`"""
for res in snapshot_cli(snapshot, ["-l"]):
diff --git a/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSync/test_missing_mac/output b/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSync/test_missing_mac/output
index c424727..1bbeb6d 100644
--- a/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSync/test_missing_mac/output
+++ b/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSync/test_missing_mac/output
@@ -7,9 +7,9 @@ STDOUT:
-------------------------------------------------------------
STDERR:
=======
-usage: bt-dualboot [-h] [-l] [--list-win-mounts] [--bot] [--dry-run]
- [--win MOUNT] [--sync MAC [MAC ...]] [--sync-all] [-n]
- [-b [path]]
+usage: bt-dualboot [-h] [--version] [-l] [--list-win-mounts] [--bot]
+ [--dry-run] [--win MOUNT] [--sync MAC [MAC ...]]
+ [--sync-all] [-n] [-b [path]]
bt-dualboot: error: argument --sync: expected at least one argument
------------------------------------------------------------- \ No newline at end of file
diff --git a/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSync/test_require_backup/output b/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSync/test_require_backup/output
index 66f4823..b2baeb0 100644
--- a/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSync/test_require_backup/output
+++ b/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSync/test_require_backup/output
@@ -7,9 +7,9 @@ STDOUT:
-------------------------------------------------------------
STDERR:
=======
-usage: bt-dualboot [-h] [-l] [--list-win-mounts] [--bot] [--dry-run]
- [--win MOUNT] [--sync MAC [MAC ...]] [--sync-all] [-n]
- [-b [path]]
+usage: bt-dualboot [-h] [--version] [-l] [--list-win-mounts] [--bot]
+ [--dry-run] [--win MOUNT] [--sync MAC [MAC ...]]
+ [--sync-all] [-n] [-b [path]]
bt-dualboot: error: Neither backup option given!
Windows Registry Hive file will be updated!
diff --git a/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSync/test_wrong_separator/output b/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSync/test_wrong_separator/output
index 92a3be0..cde8d9e 100644
--- a/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSync/test_wrong_separator/output
+++ b/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSync/test_wrong_separator/output
@@ -7,9 +7,9 @@ STDOUT:
-------------------------------------------------------------
STDERR:
=======
-usage: bt-dualboot [-h] [-l] [--list-win-mounts] [--bot] [--dry-run]
- [--win MOUNT] [--sync MAC [MAC ...]] [--sync-all] [-n]
- [-b [path]]
+usage: bt-dualboot [-h] [--version] [-l] [--list-win-mounts] [--bot]
+ [--dry-run] [--win MOUNT] [--sync MAC [MAC ...]]
+ [--sync-all] [-n] [-b [path]]
bt-dualboot: error: argument --sync: unexpected characters! Allowed letters A-F, digits 0-9 and colon, use space as separator.
------------------------------------------------------------- \ No newline at end of file
diff --git a/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSyncAll/test_require_backup/output b/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSyncAll/test_require_backup/output
index d34e35f..0562c10 100644
--- a/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSyncAll/test_require_backup/output
+++ b/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSyncAll/test_require_backup/output
@@ -7,9 +7,9 @@ STDOUT:
-------------------------------------------------------------
STDERR:
=======
-usage: bt-dualboot [-h] [-l] [--list-win-mounts] [--bot] [--dry-run]
- [--win MOUNT] [--sync MAC [MAC ...]] [--sync-all] [-n]
- [-b [path]]
+usage: bt-dualboot [-h] [--version] [-l] [--list-win-mounts] [--bot]
+ [--dry-run] [--win MOUNT] [--sync MAC [MAC ...]]
+ [--sync-all] [-n] [-b [path]]
bt-dualboot: error: Neither backup option given!
Windows Registry Hive file will be updated!
diff --git a/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSyncAll/test_sync_all_and_sync/output b/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSyncAll/test_sync_all_and_sync/output
index 23d6b32..e85115c 100644
--- a/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSyncAll/test_sync_all_and_sync/output
+++ b/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSyncAll/test_sync_all_and_sync/output
@@ -7,9 +7,9 @@ STDOUT:
-------------------------------------------------------------
STDERR:
=======
-usage: bt-dualboot [-h] [-l] [--list-win-mounts] [--bot] [--dry-run]
- [--win MOUNT] [--sync MAC [MAC ...]] [--sync-all] [-n]
- [-b [path]]
+usage: bt-dualboot [-h] [--version] [-l] [--list-win-mounts] [--bot]
+ [--dry-run] [--win MOUNT] [--sync MAC [MAC ...]]
+ [--sync-all] [-n] [-b [path]]
bt-dualboot: error: `--sync-all` can't be used alongside with `--sync MAC`
------------------------------------------------------------- \ No newline at end of file
diff --git a/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSyncAllDryRun/test_require_backup/output b/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSyncAllDryRun/test_require_backup/output
index 5f43b42..55601b6 100644
--- a/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSyncAllDryRun/test_require_backup/output
+++ b/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSyncAllDryRun/test_require_backup/output
@@ -7,9 +7,9 @@ STDOUT:
-------------------------------------------------------------
STDERR:
=======
-usage: bt-dualboot [-h] [-l] [--list-win-mounts] [--bot] [--dry-run]
- [--win MOUNT] [--sync MAC [MAC ...]] [--sync-all] [-n]
- [-b [path]]
+usage: bt-dualboot [-h] [--version] [-l] [--list-win-mounts] [--bot]
+ [--dry-run] [--win MOUNT] [--sync MAC [MAC ...]]
+ [--sync-all] [-n] [-b [path]]
bt-dualboot: error: Neither backup option given!
Windows Registry Hive file will be updated!
diff --git a/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSyncAllDryRun/test_sync_all_and_sync/output b/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSyncAllDryRun/test_sync_all_and_sync/output
index ce114a6..3e94666 100644
--- a/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSyncAllDryRun/test_sync_all_and_sync/output
+++ b/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSyncAllDryRun/test_sync_all_and_sync/output
@@ -7,9 +7,9 @@ STDOUT:
-------------------------------------------------------------
STDERR:
=======
-usage: bt-dualboot [-h] [-l] [--list-win-mounts] [--bot] [--dry-run]
- [--win MOUNT] [--sync MAC [MAC ...]] [--sync-all] [-n]
- [-b [path]]
+usage: bt-dualboot [-h] [--version] [-l] [--list-win-mounts] [--bot]
+ [--dry-run] [--win MOUNT] [--sync MAC [MAC ...]]
+ [--sync-all] [-n] [-b [path]]
bt-dualboot: error: `--sync-all` can't be used alongside with `--sync MAC`
------------------------------------------------------------- \ No newline at end of file
diff --git a/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSyncDryRun/test_missing_mac/output b/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSyncDryRun/test_missing_mac/output
index 6331468..bd5df08 100644
--- a/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSyncDryRun/test_missing_mac/output
+++ b/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSyncDryRun/test_missing_mac/output
@@ -7,9 +7,9 @@ STDOUT:
-------------------------------------------------------------
STDERR:
=======
-usage: bt-dualboot [-h] [-l] [--list-win-mounts] [--bot] [--dry-run]
- [--win MOUNT] [--sync MAC [MAC ...]] [--sync-all] [-n]
- [-b [path]]
+usage: bt-dualboot [-h] [--version] [-l] [--list-win-mounts] [--bot]
+ [--dry-run] [--win MOUNT] [--sync MAC [MAC ...]]
+ [--sync-all] [-n] [-b [path]]
bt-dualboot: error: argument --sync: expected at least one argument
------------------------------------------------------------- \ No newline at end of file
diff --git a/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSyncDryRun/test_require_backup/output b/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSyncDryRun/test_require_backup/output
index aca39ef..b152f24 100644
--- a/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSyncDryRun/test_require_backup/output
+++ b/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSyncDryRun/test_require_backup/output
@@ -7,9 +7,9 @@ STDOUT:
-------------------------------------------------------------
STDERR:
=======
-usage: bt-dualboot [-h] [-l] [--list-win-mounts] [--bot] [--dry-run]
- [--win MOUNT] [--sync MAC [MAC ...]] [--sync-all] [-n]
- [-b [path]]
+usage: bt-dualboot [-h] [--version] [-l] [--list-win-mounts] [--bot]
+ [--dry-run] [--win MOUNT] [--sync MAC [MAC ...]]
+ [--sync-all] [-n] [-b [path]]
bt-dualboot: error: Neither backup option given!
Windows Registry Hive file will be updated!
diff --git a/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSyncDryRun/test_wrong_separator/output b/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSyncDryRun/test_wrong_separator/output
index 5fbf74b..fb62756 100644
--- a/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSyncDryRun/test_wrong_separator/output
+++ b/tests_integration/cli/env_single_windows/snapshots/test_cli/TestSyncDryRun/test_wrong_separator/output
@@ -7,9 +7,9 @@ STDOUT:
-------------------------------------------------------------
STDERR:
=======
-usage: bt-dualboot [-h] [-l] [--list-win-mounts] [--bot] [--dry-run]
- [--win MOUNT] [--sync MAC [MAC ...]] [--sync-all] [-n]
- [-b [path]]
+usage: bt-dualboot [-h] [--version] [-l] [--list-win-mounts] [--bot]
+ [--dry-run] [--win MOUNT] [--sync MAC [MAC ...]]
+ [--sync-all] [-n] [-b [path]]
bt-dualboot: error: argument --sync: unexpected characters! Allowed letters A-F, digits 0-9 and colon, use space as separator.
------------------------------------------------------------- \ No newline at end of file
diff --git a/tests_integration/cli/env_single_windows/snapshots/test_cli/test_backup_without_sync/output b/tests_integration/cli/env_single_windows/snapshots/test_cli/test_backup_without_sync/output
index afcff9c..e80fc37 100644
--- a/tests_integration/cli/env_single_windows/snapshots/test_cli/test_backup_without_sync/output
+++ b/tests_integration/cli/env_single_windows/snapshots/test_cli/test_backup_without_sync/output
@@ -7,9 +7,9 @@ STDOUT:
-------------------------------------------------------------
STDERR:
=======
-usage: bt-dualboot [-h] [-l] [--list-win-mounts] [--bot] [--dry-run]
- [--win MOUNT] [--sync MAC [MAC ...]] [--sync-all] [-n]
- [-b [path]]
+usage: bt-dualboot [-h] [--version] [-l] [--list-win-mounts] [--bot]
+ [--dry-run] [--win MOUNT] [--sync MAC [MAC ...]]
+ [--sync-all] [-n] [-b [path]]
bt-dualboot: error: --backup/--no-backup options makes sense only with --sync/--sync-all options
------------------------------------------------------------- \ No newline at end of file
diff --git a/tests_integration/cli/env_single_windows/snapshots/test_cli/test_no_args/output b/tests_integration/cli/env_single_windows/snapshots/test_cli/test_no_args/output
index 3db40f8..c1dd330 100644
--- a/tests_integration/cli/env_single_windows/snapshots/test_cli/test_no_args/output
+++ b/tests_integration/cli/env_single_windows/snapshots/test_cli/test_no_args/output
@@ -3,14 +3,15 @@ CMD: /src/bt-dualboot
RETCODE=0
STDOUT:
=======
-usage: bt-dualboot [-h] [-l] [--list-win-mounts] [--bot] [--dry-run]
- [--win MOUNT] [--sync MAC [MAC ...]] [--sync-all] [-n]
- [-b [path]]
+usage: bt-dualboot [-h] [--version] [-l] [--list-win-mounts] [--bot]
+ [--dry-run] [--win MOUNT] [--sync MAC [MAC ...]]
+ [--sync-all] [-n] [-b [path]]
-Sync bluetooth keys from Linux to Windows.
+Sync bluetooth keys from Linux to Windows (v0.1.3)
optional arguments:
-h, --help show this help message and exit
+ --version print version
List resources:
-l, --list [root required] list bluetooth devices
diff --git a/tests_integration/cli/env_single_windows/snapshots/test_cli/test_no_args_but_win/output b/tests_integration/cli/env_single_windows/snapshots/test_cli/test_no_args_but_win/output
index f25f4ef..7d92bbd 100644
--- a/tests_integration/cli/env_single_windows/snapshots/test_cli/test_no_args_but_win/output
+++ b/tests_integration/cli/env_single_windows/snapshots/test_cli/test_no_args_but_win/output
@@ -7,9 +7,9 @@ STDOUT:
-------------------------------------------------------------
STDERR:
=======
-usage: bt-dualboot [-h] [-l] [--list-win-mounts] [--bot] [--dry-run]
- [--win MOUNT] [--sync MAC [MAC ...]] [--sync-all] [-n]
- [-b [path]]
+usage: bt-dualboot [-h] [--version] [-l] [--list-win-mounts] [--bot]
+ [--dry-run] [--win MOUNT] [--sync MAC [MAC ...]]
+ [--sync-all] [-n] [-b [path]]
bt-dualboot: error: missing required argument
------------------------------------------------------------- \ No newline at end of file
diff --git a/tests_integration/cli/env_single_windows/snapshots/test_cli/test_no_backup_and_backup/output b/tests_integration/cli/env_single_windows/snapshots/test_cli/test_no_backup_and_backup/output
index c00b5c8..40dac02 100644
--- a/tests_integration/cli/env_single_windows/snapshots/test_cli/test_no_backup_and_backup/output
+++ b/tests_integration/cli/env_single_windows/snapshots/test_cli/test_no_backup_and_backup/output
@@ -7,9 +7,9 @@ STDOUT:
-------------------------------------------------------------
STDERR:
=======
-usage: bt-dualboot [-h] [-l] [--list-win-mounts] [--bot] [--dry-run]
- [--win MOUNT] [--sync MAC [MAC ...]] [--sync-all] [-n]
- [-b [path]]
+usage: bt-dualboot [-h] [--version] [-l] [--list-win-mounts] [--bot]
+ [--dry-run] [--win MOUNT] [--sync MAC [MAC ...]]
+ [--sync-all] [-n] [-b [path]]
bt-dualboot: error: `--backup` can't be used alongside with `--no-backup`
------------------------------------------------------------- \ No newline at end of file
diff --git a/tests_integration/cli/env_single_windows/snapshots/test_cli/test_no_backup_without_sync/output b/tests_integration/cli/env_single_windows/snapshots/test_cli/test_no_backup_without_sync/output
index 74c7360..1eafbe6 100644
--- a/tests_integration/cli/env_single_windows/snapshots/test_cli/test_no_backup_without_sync/output
+++ b/tests_integration/cli/env_single_windows/snapshots/test_cli/test_no_backup_without_sync/output
@@ -7,9 +7,9 @@ STDOUT:
-------------------------------------------------------------
STDERR:
=======
-usage: bt-dualboot [-h] [-l] [--list-win-mounts] [--bot] [--dry-run]
- [--win MOUNT] [--sync MAC [MAC ...]] [--sync-all] [-n]
- [-b [path]]
+usage: bt-dualboot [-h] [--version] [-l] [--list-win-mounts] [--bot]
+ [--dry-run] [--win MOUNT] [--sync MAC [MAC ...]]
+ [--sync-all] [-n] [-b [path]]
bt-dualboot: error: --backup/--no-backup options makes sense only with --sync/--sync-all options
------------------------------------------------------------- \ No newline at end of file
diff --git a/tests_integration/helpers.py b/tests_integration/helpers.py
index 0788442..8440b37 100644
--- a/tests_integration/helpers.py
+++ b/tests_integration/helpers.py
@@ -6,6 +6,7 @@ from contextlib import contextmanager
from operator import itemgetter
from pytest import fixture
+from bt_dualboot import APP_NAME
@fixture(scope="session")
@@ -50,7 +51,7 @@ def debug_shell(request):
def cli_name():
- return "bt-dualboot"
+ return APP_NAME
def project_root():