summaryrefslogtreecommitdiffstats
path: root/contrib/python/argcomplete
diff options
context:
space:
mode:
authorrobot-piglet <[email protected]>2026-01-26 18:46:54 +0300
committerrobot-piglet <[email protected]>2026-01-26 18:57:59 +0300
commitb8bd9573aab1d92b6f401bf71a3e46263cc0fefb (patch)
tree5f5e6e9738280b06613634f3f8edf51e84daba12 /contrib/python/argcomplete
parent6df36e9e74894518323790af210799941811a121 (diff)
Intermediate changes
commit_hash:6f0386bb391f79a93d03af9b1c6d3e4f477c7925
Diffstat (limited to 'contrib/python/argcomplete')
-rw-r--r--contrib/python/argcomplete/py3/.dist-info/METADATA4
-rw-r--r--contrib/python/argcomplete/py3/README.rst2
-rw-r--r--contrib/python/argcomplete/py3/argcomplete/bash_completion.d/_python-argcomplete5
-rw-r--r--contrib/python/argcomplete/py3/argcomplete/finders.py16
-rw-r--r--contrib/python/argcomplete/py3/argcomplete/scripts/activate_global_python_argcomplete.py4
-rw-r--r--contrib/python/argcomplete/py3/argcomplete/shell_integration.py18
-rw-r--r--contrib/python/argcomplete/py3/ya.make2
7 files changed, 32 insertions, 19 deletions
diff --git a/contrib/python/argcomplete/py3/.dist-info/METADATA b/contrib/python/argcomplete/py3/.dist-info/METADATA
index c8d45d5d152..33d51a548ba 100644
--- a/contrib/python/argcomplete/py3/.dist-info/METADATA
+++ b/contrib/python/argcomplete/py3/.dist-info/METADATA
@@ -1,6 +1,6 @@
Metadata-Version: 2.4
Name: argcomplete
-Version: 3.6.2
+Version: 3.6.3
Summary: Bash tab completion for argparse
Project-URL: Homepage, https://github.com/kislyuk/argcomplete
Project-URL: Documentation, https://kislyuk.github.io/argcomplete
@@ -51,7 +51,7 @@ Argcomplete provides easy, extensible command line tab completion of arguments f
It makes two assumptions:
-* You're using bash or zsh as your shell
+* You're using bash or zsh as your shell (limited support exists for other shells - see below)
* You're using `argparse <http://docs.python.org/3/library/argparse.html>`_ to manage your command line arguments/options
Argcomplete is particularly useful if your program has lots of options or subparsers, and if your program can
diff --git a/contrib/python/argcomplete/py3/README.rst b/contrib/python/argcomplete/py3/README.rst
index c897ad4191e..0a69e017097 100644
--- a/contrib/python/argcomplete/py3/README.rst
+++ b/contrib/python/argcomplete/py3/README.rst
@@ -6,7 +6,7 @@ Argcomplete provides easy, extensible command line tab completion of arguments f
It makes two assumptions:
-* You're using bash or zsh as your shell
+* You're using bash or zsh as your shell (limited support exists for other shells - see below)
* You're using `argparse <http://docs.python.org/3/library/argparse.html>`_ to manage your command line arguments/options
Argcomplete is particularly useful if your program has lots of options or subparsers, and if your program can
diff --git a/contrib/python/argcomplete/py3/argcomplete/bash_completion.d/_python-argcomplete b/contrib/python/argcomplete/py3/argcomplete/bash_completion.d/_python-argcomplete
index 81c9d41f803..1155f1ce5e8 100644
--- a/contrib/python/argcomplete/py3/argcomplete/bash_completion.d/_python-argcomplete
+++ b/contrib/python/argcomplete/py3/argcomplete/bash_completion.d/_python-argcomplete
@@ -193,7 +193,8 @@ _python_argcomplete_global() {
if (__python_argcomplete_scan_head_noerr "$SCRIPT_NAME" easy_install \
&& "${interpreter[@]}" "$(__python_argcomplete_which python-argcomplete-check-easy-install-script)" "$SCRIPT_NAME") >/dev/null 2>&1; then
ARGCOMPLETE=1
- elif __python_argcomplete_run "${interpreter[@]}" -m argcomplete._check_console_script "$SCRIPT_NAME"; then
+ elif ([[ "${interpreter[@]}" == *python* ]] || [[ "${interpreter[@]}" == *pypy* ]])\
+ && __python_argcomplete_run "${interpreter[@]}" -m argcomplete._check_console_script "$SCRIPT_NAME"; then
ARGCOMPLETE=1
fi
fi
@@ -215,7 +216,7 @@ _python_argcomplete_global() {
if is-at-least 5.8; then
nosort=(-o nosort)
fi
- if [[ "${completions-}" =~ ([^\\]): && "${BASH_REMATCH[2]}" =~ [=/:] ]]; then
+ if [[ "${completions-}" =~ ([^\\\\]): && "${BASH_REMATCH[2]}" =~ [=/:] ]]; then
nospace=(-S '')
fi
_describe "$executable" completions "${nosort[@]}" "${nospace[@]}"
diff --git a/contrib/python/argcomplete/py3/argcomplete/finders.py b/contrib/python/argcomplete/py3/argcomplete/finders.py
index 8d248fd973b..ab8bb1d90a2 100644
--- a/contrib/python/argcomplete/py3/argcomplete/finders.py
+++ b/contrib/python/argcomplete/py3/argcomplete/finders.py
@@ -48,6 +48,7 @@ class CompletionFinder(object):
append_space=None,
):
self._parser = argument_parser
+ self._formatter = None
self.always_complete_options = always_complete_options
self.exclude = exclude
if validator is None:
@@ -283,6 +284,15 @@ class CompletionFinder(object):
return self.active_parsers
+ def _get_action_help(self, action):
+ if action.help is None:
+ return ""
+ if "%" not in action.help:
+ return action.help
+ if self._formatter is None:
+ self._formatter = self._parser.formatter_class(prog=self._parser.prog)
+ return self._formatter._expand_help(action)
+
def _get_subparser_completions(self, parser, cword_prefix):
aliases_by_parser: Dict[argparse.ArgumentParser, List[str]] = {}
for key in parser.choices.keys():
@@ -292,7 +302,7 @@ class CompletionFinder(object):
for action in parser._get_subactions():
for alias in aliases_by_parser[parser.choices[action.dest]]:
if alias.startswith(cword_prefix):
- self._display_completions[alias] = action.help or ""
+ self._display_completions[alias] = self._get_action_help(action)
completions = [subcmd for subcmd in parser.choices.keys() if subcmd.startswith(cword_prefix)]
return completions
@@ -313,7 +323,7 @@ class CompletionFinder(object):
if action.option_strings:
for option_string in action.option_strings:
if option_string.startswith(cword_prefix):
- self._display_completions[option_string] = action.help or ""
+ self._display_completions[option_string] = self._get_action_help(action)
option_completions = []
for action in parser._actions:
@@ -405,7 +415,7 @@ class CompletionFinder(object):
if self.validator(completion, cword_prefix):
completions.append(completion)
if isinstance(completer, ChoicesCompleter):
- self._display_completions[completion] = active_action.help or ""
+ self._display_completions[completion] = self._get_action_help(active_action)
else:
self._display_completions[completion] = ""
else:
diff --git a/contrib/python/argcomplete/py3/argcomplete/scripts/activate_global_python_argcomplete.py b/contrib/python/argcomplete/py3/argcomplete/scripts/activate_global_python_argcomplete.py
index 8e7d27de6cd..6d2287575a8 100644
--- a/contrib/python/argcomplete/py3/argcomplete/scripts/activate_global_python_argcomplete.py
+++ b/contrib/python/argcomplete/py3/argcomplete/scripts/activate_global_python_argcomplete.py
@@ -79,7 +79,9 @@ def install_to_destination(dest):
try:
os.makedirs(destdir, exist_ok=True)
except Exception as e:
- parser.error(f"path {destdir} does not exist and could not be created: {e}")
+ parser.error(
+ f"path {destdir} does not exist and could not be created: {e}. Please run this command using sudo, or see --help for more options."
+ )
try:
print(f"Installing {activator} to {dest}...", file=sys.stderr)
shutil.copy(activator, dest)
diff --git a/contrib/python/argcomplete/py3/argcomplete/shell_integration.py b/contrib/python/argcomplete/py3/argcomplete/shell_integration.py
index 3d592dc0ab8..bce5b7978d1 100644
--- a/contrib/python/argcomplete/py3/argcomplete/shell_integration.py
+++ b/contrib/python/argcomplete/py3/argcomplete/shell_integration.py
@@ -47,7 +47,7 @@ _python_argcomplete%(function_suffix)s() {
if is-at-least 5.8; then
nosort=(-o nosort)
fi
- if [[ "${completions-}" =~ ([^\\]): && "${match[1]}" =~ [=/:] ]]; then
+ if [[ "${completions-}" =~ ([^\\\\]): && "${match[1]}" =~ [=/:] ]]; then
nospace=(-S '')
fi
_describe "${words[1]}" completions "${nosort[@]}" "${nospace[@]}"
@@ -94,14 +94,14 @@ complete "%(executable)s" 'p@*@`python-argcomplete-tcsh "%(argcomplete_script)s"
fishcode = r"""
function __fish_%(function_name)s_complete
- set -x _ARGCOMPLETE 1
- set -x _ARGCOMPLETE_DFS \t
- set -x _ARGCOMPLETE_IFS \n
- set -x _ARGCOMPLETE_SUPPRESS_SPACE 1
- set -x _ARGCOMPLETE_SHELL fish
- set -x COMP_LINE (commandline -p)
- set -x COMP_POINT (string length (commandline -cp))
- set -x COMP_TYPE
+ set -lx _ARGCOMPLETE 1
+ set -lx _ARGCOMPLETE_DFS \t
+ set -lx _ARGCOMPLETE_IFS \n
+ set -lx _ARGCOMPLETE_SUPPRESS_SPACE 1
+ set -lx _ARGCOMPLETE_SHELL fish
+ set -lx COMP_LINE (commandline -p)
+ set -lx COMP_POINT (string length (commandline -cp))
+ set -lx COMP_TYPE
if set -q _ARC_DEBUG
%(argcomplete_script)s 8>&1 9>&2 1>&9 2>&1
else
diff --git a/contrib/python/argcomplete/py3/ya.make b/contrib/python/argcomplete/py3/ya.make
index 6d1fd084471..1ffd0082bb2 100644
--- a/contrib/python/argcomplete/py3/ya.make
+++ b/contrib/python/argcomplete/py3/ya.make
@@ -2,7 +2,7 @@
PY3_LIBRARY()
-VERSION(3.6.2)
+VERSION(3.6.3)
LICENSE(Apache-2.0)