diff --git a/src/borg/archiver/completion_cmd.py b/src/borg/archiver/completion_cmd.py index 1268abf84..152e3ae93 100644 --- a/src/borg/archiver/completion_cmd.py +++ b/src/borg/archiver/completion_cmd.py @@ -52,9 +52,6 @@ The following argument types have intelligent, context-aware completion: import shtab -from jsonargparse._actions import _ActionSubCommands -from jsonargparse._completions import prepare_actions_context, shtab_prepare_actions, bash_compgen_typehint - from ._common import process_epilog from ..constants import * # NOQA from ..helpers import ( @@ -69,6 +66,8 @@ from ..helpers import ( parse_file_size, ) from ..helpers.argparsing import ArgumentParser, RawDescriptionHelpFormatter +from ..helpers.argparsing import _ActionSubCommands +from ..helpers.argparsing import prepare_actions_context, shtab_prepare_actions, bash_compgen_typehint from ..helpers.time import timestamp from ..helpers.parseformat import partial_format from ..manifest import AI_HUMAN_SORT_KEYS diff --git a/src/borg/helpers/argparsing.py b/src/borg/helpers/argparsing.py index a726a6d8e..67d2026a2 100644 --- a/src/borg/helpers/argparsing.py +++ b/src/borg/helpers/argparsing.py @@ -5,6 +5,11 @@ from typing import Any from argparse import Action, ArgumentError, ArgumentTypeError, RawDescriptionHelpFormatter # noqa: F401 from jsonargparse import ArgumentParser, Namespace, SUPPRESS, REMAINDER # noqa: F401 +# borg completion uses these private symbols, so we need to import them: +from jsonargparse._actions import _ActionSubCommands # noqa: F401 +from jsonargparse._completions import prepare_actions_context, shtab_prepare_actions # noqa: F401 +from jsonargparse._completions import bash_compgen_typehint # noqa: F401 + def flatten_namespace(ns: Any) -> Namespace: """