mirror of
https://github.com/token2/snapd.git
synced 2026-03-13 11:15:47 -07:00
completion functions (and commands, which we treat the same way) are documented as receiving three arguments. I hadn't noticed, as almost nobody uses them because most everything you need is in the different COMP_ variables, but python's argcomplete module uses it. This fixes that, and adds a spread test just in case.
13 lines
360 B
Bash
13 lines
360 B
Bash
# -*- sh -*-
|
|
|
|
# this is about stopping lp:1802721 (the second part, about the python
|
|
# tab completion failing)
|
|
|
|
_complete() {
|
|
if [[ ! "$1" =~ ^test-snapd-complexion ]]; then exit 1; fi
|
|
COMPREPLY=($( compgen -W "won too tree" "${COMP_WORDS[$COMP_CWORD]}" ))
|
|
}
|
|
|
|
complete -F _complete test-snapd-complexion
|
|
complete -F _complete test-snapd-complexion.two
|