search: remove client-side default for --limit

The daemon (and registry) already have a default limit. This patch
removes the default from the client side, to not duplicate setting
these defaults.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2022-03-15 15:06:35 +01:00
parent 2dc178c802
commit ccbaaf0722
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
3 changed files with 4 additions and 7 deletions

View File

@ -38,8 +38,7 @@ func NewSearchCommand(dockerCli command.Cli) *cobra.Command {
flags.BoolVar(&options.noTrunc, "no-trunc", false, "Don't truncate output") flags.BoolVar(&options.noTrunc, "no-trunc", false, "Don't truncate output")
flags.VarP(&options.filter, "filter", "f", "Filter output based on conditions provided") flags.VarP(&options.filter, "filter", "f", "Filter output based on conditions provided")
// TODO(thaJeztah) remove default from client as the daemon already has a default flags.IntVar(&options.limit, "limit", 0, "Max number of search results")
flags.IntVar(&options.limit, "limit", 25, "Max number of search results")
flags.StringVar(&options.format, "format", "", "Pretty-print search using a Go template") flags.StringVar(&options.format, "format", "", "Pretty-print search using a Go template")
return cmd return cmd

View File

@ -18,7 +18,7 @@ Options:
- stars=<number> - image has at least 'number' stars - stars=<number> - image has at least 'number' stars
--format string Pretty-print images using a Go template --format string Pretty-print images using a Go template
--help Print usage --help Print usage
--limit int Max number of search results (default 25) --limit int Max number of search results
--no-trunc Don't truncate output --no-trunc Don't truncate output
``` ```
@ -79,8 +79,8 @@ radial/busyboxplus Full-chain, Internet enabled, busybox made from scratch. Co
### Limit search results (--limit) ### Limit search results (--limit)
The flag `--limit` is the maximum number of results returned by a search. This value could The flag `--limit` is the maximum number of results returned by a search. If no
be in the range between 1 and 100. The default value of `--limit` is 25. value is set, the default is set by the daemon.
### Filtering ### Filtering

View File

@ -2,8 +2,6 @@ Search Docker Hub for images that match the specified `TERM`. The table
of images returned displays the name, description (truncated by default), number of images returned displays the name, description (truncated by default), number
of stars awarded, whether the image is official, and whether it is automated. of stars awarded, whether the image is official, and whether it is automated.
*Note* - Search queries will only return up to 25 results
## Filter ## Filter
Filter output based on these conditions: Filter output based on these conditions: