Skip to content

Commit 3f479c1

Browse files
committed
docs(__load_completion): elaborate on preserving basename
1 parent f16dd80 commit 3f479c1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bash_completion

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2512,7 +2512,10 @@ __load_completion()
25122512
local ret realcmd="" origcmd=$cmd
25132513
if _comp_realcommand "$cmd"; then
25142514
realcmd=$ret
2515-
cmd=${realcmd%/*}/$cmdname # basename could be an alias
2515+
# Retain original basename, target $realcmd might behave differently
2516+
# depending on what it gets invoked as, so we should not install
2517+
# a completion for a different one for it. For example `busybox`.
2518+
cmd=${realcmd%/*}/$cmdname
25162519
fi
25172520
25182521
local -a dirs=()

0 commit comments

Comments
 (0)