composer-cli: Update bash completion for start-ostree

This commit is contained in:
Brian C. Lane 2020-06-05 15:50:11 -07:00
parent abf4bfe4b5
commit c054d0184a

View File

@ -3,7 +3,7 @@
__composer_cli_flags="-h --help -j --json -s --socket --log -a --api --test -V"
declare -A __composer_cli_cmds=(
[compose]="list start types status log cancel delete info metadata logs results image"
[compose]="list start start-ostree types status log cancel delete info metadata logs results image"
[blueprints]="list show changes diff save delete depsolve push freeze tag undo workspace"
[modules]="list"
[projects]="list info"
@ -112,7 +112,7 @@ _composer_cli() {
blueprints:freeze)
COMPREPLY=($(compgen -W "$(__composer_blueprints) show save" -- "${cur}"))
;;
compose:start|blueprints:*)
compose:start|compose:start-ostree|blueprints:*)
COMPREPLY=($(compgen -W "$(__composer_blueprints)" -- "${cur}"))
;;
compose:cancel)
@ -143,10 +143,11 @@ _composer_cli() {
compose:delete)
COMPREPLY=($(compgen -W "$(__composer_composes finished failed)" -- "${cur}"))
;;
compose:start)
compose:start|compose:start-ostree)
subpos="$subcmd:$cmd_cword"
if [ "$cmd_cword" == 3 ]; then
COMPREPLY=($(compgen -W "$(__composer_compose_types)" -- "${cur}"))
elif [ "$cmd_cword" == 5 ]; then
elif [ "$subpos" == "start:5" ] || [ "$subpos" == "start-ostree:7" ]; then
# If they have typed something looking like a path, use file completion
# otherwise suggest providers.
case "${cur}" in
@ -158,7 +159,7 @@ _composer_cli() {
COMPREPLY=($(compgen -W "$(__composer_provider_list)" -- "${cur}"))
;;
esac
elif [ "$cmd_cword" == 6 ]; then
elif [ "$subpos" == "start:6" ] || [ "$subpos" == "start-ostree:8" ]; then
COMPREPLY=($(compgen -W "$(__composer_profile_list ${prev})" -- "${cur}"))
fi
;;