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 <yong.tang.github@outlook.com>
This commit is contained in:
Yong Tang 2016-06-01 13:38:14 -07:00 коммит произвёл Tibor Vass
Родитель 1a22098ae2
Коммит 794db50fdf
2 изменённых файлов: 11 добавлений и 0 удалений

Просмотреть файл

@ -19,6 +19,7 @@ parent = "smn_cli"
- is-official=(true|false)
- stars=<number> - 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

Просмотреть файл

@ -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*.