From 74f70315b30e9fdd3113181d94b2e64e505a05d5 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Tue, 17 May 2022 16:20:30 +0200 Subject: shell completion: update podman inspect --type options Add all option that are supported by the podman inspect --type flag to the completions. Also use the same constants instead of duplicating the strings. In order to do this I had to move the definitions into the common package to prevent an import cycle. Signed-off-by: Paul Holzinger --- cmd/podman/common/completion.go | 3 +-- cmd/podman/common/inspect.go | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 cmd/podman/common/inspect.go (limited to 'cmd/podman/common') diff --git a/cmd/podman/common/completion.go b/cmd/podman/common/completion.go index 1275d6cc0..f207f6925 100644 --- a/cmd/podman/common/completion.go +++ b/cmd/podman/common/completion.go @@ -1141,9 +1141,8 @@ func AutocompleteImageSort(cmd *cobra.Command, args []string, toComplete string) } // AutocompleteInspectType - Autocomplete inspect type options. -// -> "container", "image", "all" func AutocompleteInspectType(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { - types := []string{"container", "image", "all"} + types := []string{AllType, ContainerType, ImageType, NetworkType, PodType, VolumeType} return types, cobra.ShellCompDirectiveNoFileComp } diff --git a/cmd/podman/common/inspect.go b/cmd/podman/common/inspect.go new file mode 100644 index 000000000..12a5af5a9 --- /dev/null +++ b/cmd/podman/common/inspect.go @@ -0,0 +1,16 @@ +package common + +const ( + // AllType can be of type ImageType or ContainerType. + AllType = "all" + // ContainerType is the container type. + ContainerType = "container" + // ImageType is the image type. + ImageType = "image" + // NetworkType is the network type + NetworkType = "network" + // PodType is the pod type. + PodType = "pod" + // VolumeType is the volume type + VolumeType = "volume" +) -- cgit v1.2.3-54-g00ecf