Skip to content

Commit

Permalink
Add completions for Manifest commands
Browse files Browse the repository at this point in the history
This adds the completions for the manifest commands
found in containers#1902.  This should not be merged until that
is merged, or perhaps this should be cherry-picked
into it.

Signed-off-by: TomSweeneyRedHat <[email protected]>
  • Loading branch information
TomSweeneyRedHat committed Oct 31, 2019
1 parent 20e92ff commit 9843320
Showing 1 changed file with 158 additions and 0 deletions.
158 changes: 158 additions & 0 deletions contrib/completions/bash/buildah
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,163 @@ return 1
esac
}

_buildah_manifest() {
local boolean_options="
--help
-h
--all
"
subcommands="
add
annotate
create
inspect
push
remove
"
__buildah_subcommands "$subcommands" && return

case "$cur" in
-*)
COMPREPLY=($(compgen -W "$boolean_options " -- "$cur"))
;;
*)
COMPREPLY=( $( compgen -W "$subcommands" -- "$cur" ) )
;;
esac

}
_buildah_manifest_add() {
local boolean_options="
--help
-h
--all
"

local options_with_args="
--annotation
--arch
--features
--os
--os-features
--os-version
--variant
"

local all_options="$options_with_args $boolean_options"

case "$cur" in
-*)
COMPREPLY=($(compgen -W "$boolean_options $options_with_args" -- "$cur"))
;;
esac
}

_buildah_manifest_annotate() {
local boolean_options="
--help
-h
"

local options_with_args="
--annotation
--arch
--features
--os
--os-features
--os-version
--variant
"

local all_options="$options_with_args $boolean_options"

case "$cur" in
-*)
COMPREPLY=($(compgen -W "$boolean_options $options_with_args" -- "$cur"))
;;
esac
}

_buildah_manifest_create() {
local boolean_options="
--help
-h
--all
"

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
}

_buildah_manifest_inspect() {
local boolean_options="
--help
-h
"

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
}

_buildah_manifest_push() {
local boolean_options="
--help
-h
--all
"

local options_with_args="
--authfile
--cert-dir
--creds
--digestfile
--purge
--tls-verify
"

local all_options="$options_with_args $boolean_options"

case "$cur" in
-*)
COMPREPLY=($(compgen -W "$boolean_options $options_with_args" -- "$cur"))
;;
esac
}

_buildah_manifest_remove() {
local boolean_options="
--help
-h
"

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
}

_buildah_mount() {
local boolean_options="
--help
Expand Down Expand Up @@ -938,6 +1095,7 @@ _buildah_containers() {
inspect
list
ls
manifest
mount
pull
push
Expand Down

0 comments on commit 9843320

Please sign in to comment.