summaryrefslogtreecommitdiffstats
path: root/share/bash-completion/container
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-07-26 03:57:11 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-07-26 03:57:11 +0000
commitf277567cc45fc61cfca8ba30d89813855440eb93 (patch)
tree2268932e0e1cb4bdd65cc17b1c3b0070d6db10d7 /share/bash-completion/container
parentAdding upstream version 20210725. (diff)
downloadopen-infrastructure-compute-tools-f277567cc45fc61cfca8ba30d89813855440eb93.tar.xz
open-infrastructure-compute-tools-f277567cc45fc61cfca8ba30d89813855440eb93.zip
Adding upstream version 20210726.upstream/20210726
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'share/bash-completion/container')
-rw-r--r--share/bash-completion/container66
1 files changed, 52 insertions, 14 deletions
diff --git a/share/bash-completion/container b/share/bash-completion/container
index 2fb49aa..bb3eb41 100644
--- a/share/bash-completion/container
+++ b/share/bash-completion/container
@@ -43,54 +43,76 @@ _container()
return 0
;;
- console)
+ build|b)
case "${prev}" in
-n|--name)
- opts="$(container list -s -f shell)"
+ opts="$(cd /etc/compute-tools/debconf 2>/dev/null && ls *.cfg */*.cfg 2>/dev/null | sed -e 's|.*/||g' -e 's|.cfg$||g')"
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
+ ;;
+
+ -s|--script)
+ opts="$(cd /usr/share/compute-tools/build-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
;;
*)
- opts="-n --name"
+ opts="-n --name -c --capability -d --drop-capability -s --script -v --verbose -b --bind --bind-ro"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
esac
;;
- create|cr)
+ console)
case "${prev}" in
-n|--name)
- opts="$(cd /etc/compute-tools/debconf 2>/dev/null && ls *.cfg */*.cfg 2>/dev/null | sed -e 's|.*/||g' -e 's|.cfg$||g')"
+ opts="$(container list -s -f shell)"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
- -s|--script)
- opts="$(cd /usr/share/compute-tools/scripts && find -maxdepth 1 -not -type d -and -not -name 'default' -and -not -name 'debconf' -and -not -name '*.d' -printf '%P\n' | sort)"
+ *)
+ opts="-n --name"
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
+ ;;
+ esac
+ ;;
+
+ enter|run)
+ case "${prev}" in
+ -n|--name)
+ opts="$(container list -s -f shell)"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
*)
- opts="-n --name -c --capability -d --drop-capability -s --script -v --verbose -b --bind --bind-ro"
+ opts="-n --name"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
esac
;;
- enter|run)
+ get|g)
case "${prev}" in
-n|--name)
- opts="$(container list -s -f shell)"
+ opts="$(cd /etc/compute-tools/debconf 2>/dev/null && ls *.cfg */*.cfg 2>/dev/null | sed -e 's|.*/||g' -e 's|.cfg$||g')"
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
+ ;;
+
+ -s|--script)
+ opts="$(cd /usr/share/compute-tools/get-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
;;
*)
- opts="-n --name"
+ opts="-n --name -c --capability -d --drop-capability -s --script -v --verbose -b --bind --bind-ro"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
@@ -114,9 +136,25 @@ _container()
;;
key)
- opts="-a --add -l --list -r --remove"
- COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
- return 0
+ case "${prev}" in
+ -a|--add)
+ opts="$(cd /usr/share/compute-tools/keys 2>/dev/null && ls *.pub 2>/dev/null | sed -e 's|.*/||g' -e 's|.pub$||g')"
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
+ ;;
+
+ -r|--remove)
+ opts="$(gpg --homedir /etc/compute-tools/keys --list-keys | grep ^uid | sed -e 's|.*<||' -e 's|>||')"
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
+ ;;
+
+ *)
+ opts="-a --add -r --remove -l --list"
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
+ ;;
+ esac
;;
limit)