summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2022-07-13 10:53:50 -0400
committerMatthew Heon <matthew.heon@pm.me>2022-07-26 13:15:45 -0400
commita4bae330a5bc76219598ffb25db7331705ff1cdd (patch)
tree0770259fbcfccedd27b655920b7fef8dec032b65
parentd560c789766f9c446c4d222fc5a0e92d86e207e1 (diff)
downloadpodman-a4bae330a5bc76219598ffb25db7331705ff1cdd.tar.gz
podman-a4bae330a5bc76219598ffb25db7331705ff1cdd.tar.bz2
podman-a4bae330a5bc76219598ffb25db7331705ff1cdd.zip
Add podman events -f to be alias for --filter
Needed for Docker compatibility. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
-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