Skip to content

Commit 9620bc9

Browse files
akinomyogascop
authored andcommitted
feat(nox): register-python-argcomplete lookup improvements
Prefer one in same path as invoked command, try `register-python-argcomplete3` too. #917 (comment)
1 parent 272ab45 commit 9620bc9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

completions/_nox

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
#
33
# This serves as a fallback in case the completion is not installed otherwise.
44

5-
eval -- "$(register-python-argcomplete --shell bash "$1" 2>/dev/null)"
5+
eval -- "$(
6+
PATH=$(type -p "$1" 2>/dev/null | sed 's,/[^/]*$,,')${PATH:+:$PATH}
7+
register-python-argcomplete --shell bash "$1" 2>/dev/null ||
8+
register-python-argcomplete3 --shell bash "$1" 2>/dev/null
9+
)"
610

711
complete -p "$1" &>/dev/null
812

0 commit comments

Comments
 (0)