diff --git a/src/borg/archiver/__init__.py b/src/borg/archiver/__init__.py index 7fe3969d1..d959f8cad 100644 --- a/src/borg/archiver/__init__.py +++ b/src/borg/archiver/__init__.py @@ -21,6 +21,7 @@ logger = create_logger() + from ._common import Highlander from .. import __version__ from ..constants import * # NOQA from ..helpers import EXIT_SUCCESS, EXIT_WARNING, EXIT_ERROR, EXIT_SIGNAL_BASE @@ -219,7 +220,15 @@ def add_common_group(self, parser, suffix, provide_defaults=False): def add_argument(*args, **kwargs): if "dest" in kwargs: kwargs.setdefault("action", "store") - assert kwargs["action"] in ("help", "store_const", "store_true", "store_false", "store", "append") + assert kwargs["action"] in ( + Highlander, + "help", + "store_const", + "store_true", + "store_false", + "store", + "append", + ) is_append = kwargs["action"] == "append" if is_append: self.append_options.add(kwargs["dest"]) diff --git a/src/borg/archiver/_common.py b/src/borg/archiver/_common.py index e43dfca42..376d4ec31 100644 --- a/src/borg/archiver/_common.py +++ b/src/borg/archiver/_common.py @@ -508,6 +508,7 @@ def define_common_options(add_common_option): dest="lock_wait", type=int, default=int(os.environ.get("BORG_LOCK_WAIT", 1)), + action=Highlander, help="wait at most SECONDS for acquiring a repository/cache lock (default: %(default)d).", ) add_common_option( @@ -525,12 +526,14 @@ def define_common_options(add_common_option): dest="umask", type=lambda s: int(s, 8), default=UMASK_DEFAULT, + action=Highlander, help="set umask to M (local only, default: %(default)04o)", ) add_common_option( "--remote-path", metavar="PATH", dest="remote_path", + action=Highlander, help='use PATH as borg executable on the remote (default: "borg")', ) add_common_option( @@ -538,6 +541,7 @@ def define_common_options(add_common_option): metavar="RATE", dest="upload_ratelimit", type=int, + action=Highlander, help="set network upload rate limit in kiByte/s (default: 0=unlimited)", ) add_common_option( @@ -545,6 +549,7 @@ def define_common_options(add_common_option): metavar="UPLOAD_BUFFER", dest="upload_buffer", type=int, + action=Highlander, help="set network upload buffer size in MiB. (default: 0=no buffer)", ) add_common_option( @@ -552,6 +557,7 @@ def define_common_options(add_common_option): metavar="FILE", dest="debug_profile", default=None, + action=Highlander, help="Write execution profile in Borg format into FILE. For local use a Python-" 'compatible file can be generated by suffixing FILE with ".pyprof".', ) @@ -559,6 +565,7 @@ def define_common_options(add_common_option): "--rsh", metavar="RSH", dest="rsh", + action=Highlander, help="Use this command to connect to the 'borg serve' process (default: 'ssh')", ) add_common_option( @@ -568,6 +575,7 @@ def define_common_options(add_common_option): dest="location", type=location_validator(other=False), default=Location(other=False), + action=Highlander, help="repository to use", )