bugfix: compress aliases for first command in completion (#40890)
This completes to `spack concretize`: ``` spack conc<tab> ``` but this still gets hung up on the difference between `concretize` and `concretise`: ``` spack -e . conc<tab> ``` We were checking `"$COMP_CWORD" = 1`, which tracks the word on the command line including any flags and their args, but we should track `"$COMP_CWORD_NO_FLAGS" = 1` to figure out if the arg we're completing is the first real command.
This commit is contained in:
parent
4755b28398
commit
f6b23b4653
2 changed files with 2 additions and 2 deletions
|
@ -370,7 +370,7 @@ _spack_compress_aliases() {
|
|||
# If there are zero or one completions, don't do anything
|
||||
# If this isn't the first argument, bail because aliases currently only apply
|
||||
# to top-level commands.
|
||||
if [ "${#COMPREPLY[@]}" -le "1" ] || [ "$COMP_CWORD" != "1" ]; then
|
||||
if [ "${#COMPREPLY[@]}" -le "1" ] || [ "$COMP_CWORD_NO_FLAGS" != "1" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
|
|
|
@ -370,7 +370,7 @@ _spack_compress_aliases() {
|
|||
# If there are zero or one completions, don't do anything
|
||||
# If this isn't the first argument, bail because aliases currently only apply
|
||||
# to top-level commands.
|
||||
if [ "${#COMPREPLY[@]}" -le "1" ] || [ "$COMP_CWORD" != "1" ]; then
|
||||
if [ "${#COMPREPLY[@]}" -le "1" ] || [ "$COMP_CWORD_NO_FLAGS" != "1" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue