diff options
author | Qi Wang <qiwan@redhat.com> | 2020-04-30 16:45:47 -0400 |
---|---|---|
committer | Qi Wang <qiwan@redhat.com> | 2020-05-01 11:20:19 -0400 |
commit | ef603de8ecf27ace01c5cfdc92f878948a33f1f6 (patch) | |
tree | cfa7b510c40ffd291458a4c7aede8ad4c08260e1 | |
parent | c31bf2e97644b76163624149bb130528c6a5a394 (diff) | |
download | podman-ef603de8ecf27ace01c5cfdc92f878948a33f1f6.tar.gz podman-ef603de8ecf27ace01c5cfdc92f878948a33f1f6.tar.bz2 podman-ef603de8ecf27ace01c5cfdc92f878948a33f1f6.zip |
search --limit compatible with docker
Check --limit range and update --limit manpage explanation.
Signed-off-by: Qi Wang <qiwan@redhat.com>
-rw-r--r-- | cmd/podman/images/search.go | 4 | ||||
-rw-r--r-- | docs/source/markdown/podman-search.1.md | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/cmd/podman/images/search.go b/cmd/podman/images/search.go index a8abfb339..a259b2419 100644 --- a/cmd/podman/images/search.go +++ b/cmd/podman/images/search.go @@ -105,6 +105,10 @@ func imageSearch(cmd *cobra.Command, args []string) error { return errors.Errorf("search requires exactly one argument") } + if searchOptions.Limit > 100 { + return errors.Errorf("Limit %d is outside the range of [1, 100]", searchOptions.Limit) + } + // TLS verification in c/image is controlled via a `types.OptionalBool` // which allows for distinguishing among set-true, set-false, unspecified // which is important to implement a sane way of dealing with defaults of diff --git a/docs/source/markdown/podman-search.1.md b/docs/source/markdown/podman-search.1.md index 31de6f839..75bfeb058 100644 --- a/docs/source/markdown/podman-search.1.md +++ b/docs/source/markdown/podman-search.1.md @@ -59,7 +59,7 @@ Valid placeholders for the Go template are listed below: **--limit**=*limit* -Limit the number of results +Limit the number of results. This value can be in the range between 1 and 100. The default number of results is 25. Note: The results from each registry will be limited to this value. Example if limit is 10 and two registries are being searched, the total number of results will be 20, 10 from each (if there are at least 10 matches in each). |