From 9843320b87437202fc11fec43f4e0f9cb7644152 Mon Sep 17 00:00:00 2001 From: TomSweeneyRedHat Date: Sat, 12 Oct 2019 15:45:04 -0400 Subject: [PATCH] Add completions for Manifest commands This adds the completions for the manifest commands found in #1902. This should not be merged until that is merged, or perhaps this should be cherry-picked into it. Signed-off-by: TomSweeneyRedHat --- contrib/completions/bash/buildah | 158 +++++++++++++++++++++++++++++++ 1 file changed, 158 insertions(+) diff --git a/contrib/completions/bash/buildah b/contrib/completions/bash/buildah index af0cbc3a20b..da5d7fed237 100644 --- a/contrib/completions/bash/buildah +++ b/contrib/completions/bash/buildah @@ -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 @@ -938,6 +1095,7 @@ _buildah_containers() { inspect list ls + manifest mount pull push