-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ps: un-deprecate --filter, and enhance docs #9266
Conversation
|
||
## Examples | ||
|
||
### <a name="format"></a> Format the output (--format) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an enhancement we made to the generator; when documenting specific flags, you can add a <a name="name-of-flag"></a>
anchor, which will then automatically be linked from the list of flags (both on GitHub and on docs.docker.com. It's a bit of a "hack" to workaround difference between GitHub flavoured markdown (for viewing on GitHub), and markdown options supported by Jekyll (as used for docs.docker.com), but it works "ok" 😂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me, thanks @thaJeztah
@@ -8,21 +8,109 @@ List containers | |||
| Name | Type | Default | Description | | |||
| --- | --- | --- | --- | | |||
| `-a`, `--all` | | | Show all stopped containers (including those created by the run command) | | |||
| `--format` | `string` | `pretty` | Format the output. Values: [pretty \| json] | | |||
| [`--format`](#format) | `string` | `pretty` | Format the output. Values: [pretty \| json] | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh! I think I missed something; the flag is not showing up here 🤔 Let me double check (was it "hidden" or so?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that was it; changed that 😅
d6f4e5d
to
6313c44
Compare
cmd/compose/ps.go
Outdated
@@ -81,12 +81,11 @@ func psCommand(p *projectOptions, backend api.Service) *cobra.Command { | |||
} | |||
flags := psCmd.Flags() | |||
flags.StringVar(&opts.Format, "format", "pretty", "Format the output. Values: [pretty | json]") | |||
flags.StringVar(&opts.Filter, "filter", "", "Filter services by a property. Deprecated, use --status instead") | |||
flags.StringVar(&opts.Filter, "filter", "", "Filter services by a property (currently supported filters: status).") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flags.StringVar(&opts.Filter, "filter", "", "Filter services by a property (currently supported filters: status).") | |
flags.StringVar(&opts.Filter, "filter", "", "Filter services by a property (supported filters: status).") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good one. I was going back-and-forth on whether I should use "currently" or not.
You're right; it looks better without; let me fix and push
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed!
Compose currently only supports a single filter options on --filter, for which reason the --status flag was added, which is more convenient to use. However, the `--filter` flag is common among various docker commands, and it's possible that additional filters get added at some point (which may be less "commonly" used, and not warrant a dedicated flag). This PR removes the "deprecated" mention from the flag, to keep consistency with other commands, but adds documentation to explain how they relate to eachother. Also added a short example for the `--format` flag. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
6313c44
to
4b6d66a
Compare
Compose currently only supports a single filter options on --filter,
for which reason the --status flag was added, which is more convenient
to use.
However, the
--filter
flag is common among various docker commands, andit's possible that additional filters get added at some point (which may
be less "commonly" used, and not warrant a dedicated flag).
This PR removes the "deprecated" mention from the flag, to keep consistency
with other commands, but adds documentation to explain how they relate to
eachother.
Also added a short example for the
--format
flag.What I did
Related issue
(not mandatory) A picture of a cute animal, if possible in relation with what you did