diff options
author | Paul Holzinger <paul.holzinger@web.de> | 2020-11-14 16:50:02 +0100 |
---|---|---|
committer | Paul Holzinger <paul.holzinger@web.de> | 2020-11-16 16:14:42 +0100 |
commit | cf4967de4d4e4abeb183217dfee130d8ec2e02f5 (patch) | |
tree | 1784ff87f8939ea960ce4e62f38c86f3afd1428c /libpod/filters/pods.go | |
parent | 738d62ea960af439bd545820e1853cbd73464493 (diff) | |
download | podman-cf4967de4d4e4abeb183217dfee130d8ec2e02f5.tar.gz podman-cf4967de4d4e4abeb183217dfee130d8ec2e02f5.tar.bz2 podman-cf4967de4d4e4abeb183217dfee130d8ec2e02f5.zip |
Improve the shell completion api
One main advantage of the new shell completion logic is that
we can easly parse flags and adjust based on the given flags
the suggestions. For example some commands accept the
`--latest` flag only if no arguments are given.
This commit implements this logic in a simple maintainable way
since it reuses the already existing `Args` function in the
cmd struct.
I also refactored the `getXXX` function to match based on the
namei/id which could speed up the shell completion with many
containers, images, etc...
I also added the degraded status to the valid pod status
filters which was implemented in #8081.
Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
Diffstat (limited to 'libpod/filters/pods.go')
-rw-r--r-- | libpod/filters/pods.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libpod/filters/pods.go b/libpod/filters/pods.go index 7d12eefa6..3cd97728f 100644 --- a/libpod/filters/pods.go +++ b/libpod/filters/pods.go @@ -88,7 +88,7 @@ func GeneratePodFilterFunc(filter, filterValue string) ( return match }, nil case "status": - if !util.StringInSlice(filterValue, []string{"stopped", "running", "paused", "exited", "dead", "created"}) { + if !util.StringInSlice(filterValue, []string{"stopped", "running", "paused", "exited", "dead", "created", "degraded"}) { return nil, errors.Errorf("%s is not a valid pod status", filterValue) } return func(p *libpod.Pod) bool { |