From 794db50fdf3e0cdc15fc6d4ce9af3fac0d0b9fe4 Mon Sep 17 00:00:00 2001 From: Yong Tang Date: Wed, 1 Jun 2016 13:38:14 -0700 Subject: [PATCH] Add `--limit` option to `docker search` This fix tries to address the issue raised in #23055. Currently `docker search` result caps at 25 and there is no way to allow getting more results (if exist). This fix adds the flag `--limit` so that it is possible to return more results from the `docker search`. Related documentation has been updated. Additional tests have been added to cover the changes. This fix fixes #23055. Signed-off-by: Yong Tang --- docs/reference/commandline/search.md | 7 +++++++ man/docker-search.1.md | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/docs/reference/commandline/search.md b/docs/reference/commandline/search.md index 8bca98f0c9..6d3984de13 100644 --- a/docs/reference/commandline/search.md +++ b/docs/reference/commandline/search.md @@ -19,6 +19,7 @@ parent = "smn_cli" - is-official=(true|false) - stars= - image has at least 'number' stars --help Print usage + --limit=25 Maximum returned search results --no-trunc Don't truncate output Search [Docker Hub](https://hub.docker.com) for images @@ -74,6 +75,12 @@ at least 3 stars and the description isn't truncated in the output: progrium/busybox 50 [OK] radial/busyboxplus Full-chain, Internet enabled, busybox made from scratch. Comes in git and cURL flavors. 8 [OK] +## Limit search results (--limit) + +The flag `--limit` is the maximium number of results returned by a search. This value could +be in the range between 1 and 100. The default value of `--limit` is 25. + + ## Filtering The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there is more diff --git a/man/docker-search.1.md b/man/docker-search.1.md index c1728f548c..ad8bbc78b2 100644 --- a/man/docker-search.1.md +++ b/man/docker-search.1.md @@ -8,6 +8,7 @@ docker-search - Search the Docker Hub for images **docker search** [**-f**|**--filter**[=*[]*]] [**--help**] +[**--limit**[=*LIMIT*]] [**--no-trunc**] TERM @@ -30,6 +31,9 @@ of stars awarded, whether the image is official, and whether it is automated. **--help** Print usage statement +**--limit**=*LIMIT* + Maximum returned search results. The default is 25. + **--no-trunc**=*true*|*false* Don't truncate output. The default is *false*.