summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoropenshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com>2022-07-14 12:01:40 +0000
committerGitHub <noreply@github.com>2022-07-14 12:01:40 +0000
commitd4dc067117931678f0a568998ff34443a12da7e3 (patch)
tree727f55a0173a8ac09e619dbad337025f4c7bcb39
parent5c3eec55895c9ca4c36571e1e919f0cb8632bedb (diff)
parentcc2cfe06025c0eec90114efc98e8ab0d00879da5 (diff)
downloadpodman-d4dc067117931678f0a568998ff34443a12da7e3.tar.gz
podman-d4dc067117931678f0a568998ff34443a12da7e3.tar.bz2
podman-d4dc067117931678f0a568998ff34443a12da7e3.zip
Merge pull request #14923 from rhatdan/events
Add podman events -f to be alias for --filter
-rw-r--r--cmd/podman/system/events.go2
-rw-r--r--docs/source/markdown/podman-events.1.md4
-rw-r--r--test/system/090-events.bats4
3 files changed, 5 insertions, 5 deletions
diff --git a/cmd/podman/system/events.go b/cmd/podman/system/events.go
index 09e589d3c..b04668f86 100644
--- a/cmd/podman/system/events.go
+++ b/cmd/podman/system/events.go
@@ -46,7 +46,7 @@ func init() {
flags := eventsCommand.Flags()
filterFlagName := "filter"
- flags.StringArrayVar(&eventOptions.Filter, filterFlagName, []string{}, "filter output")
+ flags.StringArrayVarP(&eventOptions.Filter, filterFlagName, "f", []string{}, "filter output")
_ = eventsCommand.RegisterFlagCompletionFunc(filterFlagName, common.AutocompleteEventFilter)
formatFlagName := "format"
diff --git a/docs/source/markdown/podman-events.1.md b/docs/source/markdown/podman-events.1.md
index 5d5199e66..526a7fa10 100644
--- a/docs/source/markdown/podman-events.1.md
+++ b/docs/source/markdown/podman-events.1.md
@@ -77,7 +77,7 @@ The *volume* type will report the following statuses:
## OPTIONS
-#### **--filter**=*filter*
+#### **--filter**, **-f**=*filter*
Filter events that are displayed. They must be in the format of "filter=value". The following
filters are supported:
@@ -129,7 +129,7 @@ $ podman events
Show only Podman create events
```
-$ podman events --filter event=create
+$ podman events -f event=create
2019-03-02 10:36:01.375685062 -0600 CST container create 20dc581f6fbf (image=docker.io/library/alpine:latest, name=sharp_morse)
2019-03-02 10:36:08.561188337 -0600 CST container create 58e7e002344c (image=k8s.gcr.io/pause:3.1, name=3e701f270d54-infra)
2019-03-02 10:36:13.146899437 -0600 CST volume create cad6dc50e087 (image=, name=cad6dc50e0879568e7d656bd004bd343d6035e7fc4024e1711506fe2fd459e6f)
diff --git a/test/system/090-events.bats b/test/system/090-events.bats
index 128802360..ceb53ae73 100644
--- a/test/system/090-events.bats
+++ b/test/system/090-events.bats
@@ -13,11 +13,11 @@ load helpers
run_podman run --label $labelname=$labelvalue --name $cname --rm $IMAGE ls
expect=".* container start [0-9a-f]\+ (image=$IMAGE, name=$cname,.* ${labelname}=${labelvalue}"
- run_podman events --filter type=container --filter container=$cname --filter label=${labelname}=${labelvalue} --filter event=start --stream=false
+ run_podman events --filter type=container -f container=$cname --filter label=${labelname}=${labelvalue} --filter event=start --stream=false
is "$output" "$expect" "filtering by container name and label"
# Same thing, but without the container-name filter
- run_podman events --filter type=container --filter label=${labelname}=${labelvalue} --filter event=start --stream=false
+ run_podman events -f type=container --filter label=${labelname}=${labelvalue} --filter event=start --stream=false
is "$output" "$expect" "filtering just by label"
# Now filter just by container name, no label