Closed scop closed 6 months ago
Test coverage is likely something to expand before we merge this.
Would be nice to also address --*-signal=SIG
too, but that's not a blocker I think.
I added further commits because -*
may also be treated as the command name after any variable assignments *=*
. For example, in the case of env foo=bar --debug s
, --debug
is actually treated as the command name by env
. Commit 71b7fb2bc handles it.
However, I noticed that if we pass the position of --debug
to _comp_command_offset
, _comp_load
produces error messages because it internally checks the command name by type -P "$cmd"
. So I first fixed _comp_load
(and _comp_realcommand
, which uses type -P
in a similar way) in commit 883946d84.
In addition, after the option --
and -
, any non-variable-assignment word (including -*
) is treated as the command name. Commit 0cd2883ca implements the handling of these.
Thanks!
There are actually similar cases for type -P
, but I think we should consider them in another PR.
Refs https://github.com/scop/bash-completion/issues/1111