summaryrefslogtreecommitdiffstats
path: root/share/bash-completion
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2017-01-04 10:41:54 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2017-01-04 10:42:45 +0000
commite81986238b9faadd633c22883bd4aa6152111c00 (patch)
treebd83e33713d27157ea8e8100ddc50ad9fd1844b7 /share/bash-completion
parentReleasing debian version 20161220-1. (diff)
downloadopen-infrastructure-compute-tools-e81986238b9faadd633c22883bd4aa6152111c00.tar.xz
open-infrastructure-compute-tools-e81986238b9faadd633c22883bd4aa6152111c00.zip
Merging upstream version 20170101.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'share/bash-completion')
-rw-r--r--share/bash-completion/container208
1 files changed, 97 insertions, 111 deletions
diff --git a/share/bash-completion/container b/share/bash-completion/container
index 8d54ba4..0bc22c0 100644
--- a/share/bash-completion/container
+++ b/share/bash-completion/container
@@ -36,218 +36,204 @@ _container()
fi
case "${cmd}" in
+ auto)
+ opts="-f --force -s --start -t --stop"
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
+ ;;
+
console)
- case "${cur}" in
- -*)
- opts="-n --name"
+ case "${prev}" in
+ -n|--name)
+ opts=$(container list -s -f shell)
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
*)
- case "${prev}" in
- -n|--name)
- opts=$(container list -s -f shell)
- COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
- return 0
- ;;
- esac
+ opts="-n --name"
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
;;
esac
;;
create)
- case "${cur}" in
- -*)
- opts="-n --name -c --capability -d --drop-capability -s --script -b --bind"
+ case "${prev}" in
+ -n|--name)
+ opts=$(cd /etc/container-tools/debconf 2>/dev/null && ls *.cfg 2>/dev/null | sed -e 's/.cfg$//g')
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
+ ;;
+
+ -s|--script)
+ opts=$(cd /usr/share/container-tools/scripts && find -maxdepth 1 -not -type d -and -not -name 'default' -and -not -name 'debconf' -and -not -name '*.d' -printf '%P\n' | sort)
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
*)
- case "${prev}" in
- -n|--name)
- opts=$(cd /srv/container/container-tools/debconf 2>/dev/null && ls *.cfg 2>/dev/null | sed -e 's/.cfg$//g')
- COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
- return 0
- ;;
-
- -s|--script)
- opts=$(cd /usr/share/container-tools/scripts && find -maxdepth 1 -not -type d -and -not -name 'default' -and -not -name 'debconf' -and -not -name '*.d' -printf '%P\n' | sort)
- COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
- return 0
- ;;
- esac
+ opts="-n --name -c --capability -d --drop-capability -s --script -b --bind"
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
;;
esac
;;
enter)
- case "${cur}" in
- -*)
- opts="-n --name"
+ case "${prev}" in
+ -n|--name)
+ opts=$(container list -s -f shell)
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
*)
- case "${prev}" in
- -n|--name)
- opts=$(container list -s -f shell)
- COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
- return 0
- ;;
- esac
+ opts="-n --name"
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
;;
esac
;;
limit)
- case "${cur}" in
- -*)
- opts="-n --name --blockio-device-weight --blockio-read-bandwith -b --blockio-weight --blockio-write-bandwith -c --cpu-quota --cpu-shares -m --memory-limit -t --tasks-max"
+ case "${prev}" in
+ -n|--name)
+ opts=$(container list -a -f shell)
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
*)
- case "${prev}" in
- -n|--name)
- opts=$(container list -a -f shell)
- COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
- return 0
- ;;
- esac
+ opts="-n --name --blockio-device-weight --blockio-read-bandwith -b --blockio-weight --blockio-write-bandwith -c --cpu-quota --cpu-shares -m --memory-limit -t --tasks-max"
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
;;
esac
;;
list|ls)
- case "${cur}" in
- -*)
+ case "${prev}" in
+ -h|--host)
+ opts="true false $(hostname -f)"
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
+ ;;
+
+ -f|--format)
+ opts="cli csv json nwdiag shell yaml xml"
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
+ ;;
+
+ *)
opts="-a --all -f --format -h --host -o --other -s --started -t --stopped"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
+ esac
+ ;;
+
+ move|mv)
+ case "${prev}" in
+ -o|--old)
+ opts=$(container list -t -f shell)
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
+ ;;
*)
- case "${prev}" in
- -h|--host)
- opts="true false $(hostname -f)"
- COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
- return 0
- ;;
-
- -f|--format)
- opts="cli csv json nwdiag shell yaml xml"
- COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
- return 0
- ;;
- esac
+ opts="-f --force -n --new -o --old"
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
;;
esac
;;
remove|rm)
- case "${cur}" in
- -*)
- opts="-n --name -f --force"
+ case "${prev}" in
+ -n|--name)
+ opts=$(container list -t -f shell)
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
*)
- case "${prev}" in
- -n|--name)
- opts=$(container list -t -f shell)
- COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
- return 0
- ;;
- esac
+ opts="-n --name -f --force"
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
;;
esac
;;
restart)
- case "${cur}" in
- -*)
- opts="-n --name"
+ case "${prev}" in
+ -n|--name)
+ opts=$(container list -s -f shell)
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
*)
- case "${prev}" in
- -n|--name)
- opts=$(container list -s -f shell)
- COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
- return 0
- ;;
- esac
+ opts="-n --name"
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
;;
esac
;;
start)
- case "${cur}" in
- -*)
- opts="-n --name"
+ case "${prev}" in
+ -n|--name)
+ opts=$(container list -t -f shell)
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
*)
- case "${prev}" in
- -n|--name)
- opts=$(container list -t -f shell)
- COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
- return 0
- ;;
- esac
+ opts="-n --name"
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
;;
esac
;;
status)
- case "${cur}" in
- -*)
- opts="-n --name"
+ case "${prev}" in
+ -n|--name)
+ opts=$(container list -t -f shell)
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
*)
- case "${prev}" in
- -n|--name)
- opts=$(container list -t -f shell)
- COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
- return 0
- ;;
- esac
+ opts="-n --name"
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
;;
esac
;;
stop)
- case "${cur}" in
- -*)
- opts="-n --name -f --force"
+ case "${prev}" in
+ -n|--name)
+ opts=$(container list -s -f shell)
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
*)
- case "${prev}" in
- -n|--name)
- opts=$(container list -s -f shell)
- COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
- return 0
- ;;
- esac
+ opts="-n --name -f --force"
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
;;
esac
;;
+ version)
+ return 0
+ ;;
+
*)
local commands=$(cd /usr/lib/container-tools/container 2>/dev/null && find * -type f -print)
COMPREPLY=( $(compgen -W "${commands}" -- ${cur}) )