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.
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" 😂
glours
left a comment
There was a problem hiding this comment.
Sounds good to me, thanks @thaJeztah
| | --- | --- | --- | --- | | ||
| | `-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.
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.
Yes, that was it; changed that 😅
d6f4e5d to
6313c44
Compare
cmd/compose/ps.go
Outdated
| 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.
| 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.
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
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
--filterflag 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
--formatflag.What I did
Related issue
(not mandatory) A picture of a cute animal, if possible in relation with what you did