summaryrefslogtreecommitdiffstats
path: root/share/bash-completion/container
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--share/bash-completion/container37
1 files changed, 37 insertions, 0 deletions
diff --git a/share/bash-completion/container b/share/bash-completion/container
index 4289961..3f1f271 100644
--- a/share/bash-completion/container
+++ b/share/bash-completion/container
@@ -143,6 +143,43 @@ _container()
esac
;;
+ log)
+ case "${prev}" in
+ -d|--date)
+ opts="$(if ls /var/log/container-tools/container.log-*.gz > /dev/null 2>&1;
+ then \
+ zcat /var/log/container-tools/container.log-*.gz | awk '{ print $1 }' | sort -u; \
+ fi; \
+ if [ -e /var/log/container-tools/container.log ]; \
+ then \
+ awk '{ print $1 }' /var/log/container-tools/container.log | sort -u; \
+ fi) \
+ today yesterday"
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
+ ;;
+
+ -n|--name)
+ opts="$(if ls /var/log/container-tools/container.log-*.gz > /dev/null 2>&1;
+ then \
+ zgrep -E '(\-n|\-\-name) ' /var/log/container-tools/container.log-*.gz | sed -e 's|.*-n ||' -e 's|.*--name ||' -e 's| .*$||' | sort -u; \
+ fi; \
+ if [ -e /var/log/container-tools/container.log ]; \
+ then \
+ grep -E '(\-n|\-\-name) ' /var/log/container-tools/container.log | sed -e 's|.*-n ||' -e 's|.*--name ||' -e 's| .*$||' | sort -u; \
+ fi)"
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
+ ;;
+
+ *)
+ opts="-d --date -n --name"
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
+ ;;
+ esac
+ ;;
+
move|mv)
case "${prev}" in
-o|--old)