From 599b1ed839cdc288334c5cfc557fd37e798fa575 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Wed, 18 Nov 2020 16:10:19 +0100 Subject: Shell completion for podman ps and podman pod ps --filter Add all available filter options for `podman ps` and `podman pod ps` to the completions. Refactor the code a bit to make it easier to handle key value pairs in completions. The `completeKeyValues` function helps to reduce code duplication. Also make use of the new filter logic in the completions. Signed-off-by: Paul Holzinger --- cmd/podman/pods/ps.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'cmd/podman/pods') diff --git a/cmd/podman/pods/ps.go b/cmd/podman/pods/ps.go index 51c2e92f0..99d324411 100644 --- a/cmd/podman/pods/ps.go +++ b/cmd/podman/pods/ps.go @@ -57,8 +57,7 @@ func init() { filterFlagName := "filter" flags.StringSliceVarP(&inputFilters, filterFlagName, "f", []string{}, "Filter output based on conditions given") - //TODO complete filters - _ = psCmd.RegisterFlagCompletionFunc(filterFlagName, completion.AutocompleteNone) + _ = psCmd.RegisterFlagCompletionFunc(filterFlagName, common.AutocompletePodPsFilters) formatFlagName := "format" flags.StringVar(&psInput.Format, formatFlagName, "", "Pretty-print pods to JSON or using a Go template") -- cgit v1.2.3-54-g00ecf