Skip to content

Commit

Permalink
search: remove client-side default for --limit
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
thaJeztah committed Mar 30, 2022
1 parent 2dc178c commit ccbaaf0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
3 changes: 1 addition & 2 deletions cli/command/registry/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ func NewSearchCommand(dockerCli command.Cli) *cobra.Command {

flags.BoolVar(&options.noTrunc, "no-trunc", false, "Don't truncate output")
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", 25, "Max number of search results")
flags.IntVar(&options.limit, "limit", 0, "Max number of search results")
flags.StringVar(&options.format, "format", "", "Pretty-print search using a Go template")

return cmd
Expand Down
6 changes: 3 additions & 3 deletions docs/reference/commandline/search.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Options:
- stars=<number> - image has at least 'number' stars
--format string Pretty-print images using a Go template
--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
```

Expand Down Expand Up @@ -79,8 +79,8 @@ radial/busyboxplus Full-chain, Internet enabled, busybox made from scratch. Co

### Limit search results (--limit)

The flag `--limit` is the maximum 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.
The flag `--limit` is the maximum number of results returned by a search. If no
value is set, the default is set by the daemon.

### Filtering

Expand Down
2 changes: 0 additions & 2 deletions man/src/search.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 stars awarded, whether the image is official, and whether it is automated.

*Note* - Search queries will only return up to 25 results

## Filter

Filter output based on these conditions:
Expand Down

0 comments on commit ccbaaf0

Please sign in to comment.