summaryrefslogtreecommitdiffstats
path: root/share/bash-completion
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2016-07-01 09:53:24 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2016-07-01 09:54:30 +0000
commit98e646a8fb214023ab99f661a6ad2550157c6b95 (patch)
tree0430656e1e16ec50b9eeede978c85e156a036d8a /share/bash-completion
parentReleasing debian version 20160615-2. (diff)
downloadopen-infrastructure-compute-tools-98e646a8fb214023ab99f661a6ad2550157c6b95.tar.xz
open-infrastructure-compute-tools-98e646a8fb214023ab99f661a6ad2550157c6b95.zip
Merging upstream version 20160701.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'share/bash-completion')
-rw-r--r--share/bash-completion/container (renamed from share/bash-completion/container-tools)58
1 files changed, 53 insertions, 5 deletions
diff --git a/share/bash-completion/container-tools b/share/bash-completion/container
index 219fd2f..f6434f8 100644
--- a/share/bash-completion/container-tools
+++ b/share/bash-completion/container
@@ -1,4 +1,6 @@
-# Open Infrastructure: container-tools
+# bash-completion
+#
+# container-tools - Manage systemd-nspawn containers
# Copyright (C) 2016 Andreas Kreuzer <andreas.kreuzer@open-infrastructure.net>
#
# This program is free software: you can redistribute it and/or modify
@@ -71,7 +73,27 @@ _container()
;;
-s|--script)
- opts="debootstrap debconf default"
+ 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
+ ;;
+ esac
+ ;;
+
+ enter)
+ case "${cur}" in
+ -*)
+ opts="-n --name"
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
+ ;;
+
+ *)
+ case "${prev}" in
+ -n|--name)
+ opts=$(container list -s -f short)
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
@@ -103,7 +125,7 @@ _container()
list)
case "${cur}" in
-*)
- opts="-a --all -f --format -h --host -s --started -t --stopped"
+ opts="-a --all -f --format -h --host -o --other -s --started -t --stopped"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
@@ -115,6 +137,12 @@ _container()
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
+
+ -f|--format)
+ opts="short full"
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
+ ;;
esac
;;
esac
@@ -131,7 +159,7 @@ _container()
*)
case "${prev}" in
-n|--name)
- opts=$(container list -a -f short)
+ opts=$(container list -t -f short)
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
@@ -180,6 +208,26 @@ _container()
esac
;;
+ status)
+ case "${cur}" in
+ -*)
+ opts="-n --name"
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
+ ;;
+
+ *)
+ case "${prev}" in
+ -n|--name)
+ opts=$(container list -t -f short)
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
stop)
case "${cur}" in
-*)
@@ -201,7 +249,7 @@ _container()
;;
*)
- local commands=$(ls /usr/lib/container-tools/container/)
+ local commands=$(cd /usr/lib/container-tools/container 2>/dev/null && ls)
COMPREPLY=( $(compgen -W "${commands}" -- ${cur}) )
return 0
;;