Files
snapd/tests/completion/func.complete
John Lenton ba27d6ada4 overlord/snapstate: support completion for command aliases (#4154)
This makes the code that manages command aliases aware of completion
support needs. That is: on alias CRUD, also CRUD the appropriate
symlinks for the completion snippets of the aliases.

For example, if you have a snap foo that has an app bar, and
foo.bar has a completer keyword in the yaml, then typing
foo.bar <tab> in bash will offer you completion via that snippet. If
you then snap alias foo.bar bar you'd expect to see the same
completion suggestions. This PR hooks things up so that you would, in
fact, get them.

This is invisible to the snap author -- the command completer
gets the original, unaliased completion request.
2017-11-14 17:14:32 +00:00

9 lines
199 B
Bash

# -*- sh -*-
_complete() {
COMPREPLY=($( compgen -W "won too tree" "${COMP_WORDS[$COMP_CWORD]}" ))
}
complete -F _complete test-snapd-complexion
complete -F _complete test-snapd-complexion.two