Add 'kpod images' and 'kpod rmi' commands
'kpod images' lists all images on a system. 'kpod rmi' removes one or more images from a system. The images will not be removed if they are associated with a running container, unless the -f option is used Signed-off-by: Ryan Cole <rcyoalne@gmail.com>
This commit is contained in:
parent
7fb772b7d1
commit
a040f20a76
11 changed files with 1708 additions and 8 deletions
|
@ -2,6 +2,37 @@
|
|||
|
||||
: ${PROG:=$(basename ${BASH_SOURCE})}
|
||||
|
||||
__kpod_list_images() {
|
||||
COMPREPLY=($(compgen -W "$(kpod images -q)" -- $cur))
|
||||
}
|
||||
|
||||
_kpod_images() {
|
||||
local boolean_options="
|
||||
--help
|
||||
-h
|
||||
--quiet
|
||||
-q
|
||||
--noheading
|
||||
-n
|
||||
--no-trunc
|
||||
--digests
|
||||
--format
|
||||
--filter
|
||||
-f
|
||||
"
|
||||
|
||||
local options_with_args="
|
||||
"
|
||||
|
||||
local all_options="$options_with_args $boolean_options"
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=($(compgen -W "$boolean_options $options_with_args" -- "$cur"))
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
_complete_() {
|
||||
local options_with_args=$1
|
||||
local boolean_options="$2 -h --help"
|
||||
|
@ -19,6 +50,24 @@ _complete_() {
|
|||
esac
|
||||
}
|
||||
|
||||
_kpod_rmi() {
|
||||
local boolean_options="
|
||||
--help
|
||||
-h
|
||||
--force
|
||||
-f
|
||||
"
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=($(compgen -W "$boolean_options $options_with_args" -- "$cur"))
|
||||
;;
|
||||
*)
|
||||
__kpod_list_images
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
_kpod_launch() {
|
||||
local options_with_args="
|
||||
"
|
||||
|
@ -60,7 +109,9 @@ _kpod_kpod() {
|
|||
--help -h
|
||||
"
|
||||
commands="
|
||||
images
|
||||
launch
|
||||
rmi
|
||||
tag
|
||||
version
|
||||
pull
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue