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
Proposal: docker ps: add fields for ordering and column selection #10255
Conversation
This is my first contribution to the docker project, I apologize for any errors. This adds a |
Thanks for your first contribution! We are super excited to have you! Now since your PR is changing the UX of docker ps it is going to need UX review. Seeing as we are in the middle of the release process, about to make release candidate binaries and try and test and fix all bugs that are found it might take a little longer for us to get to this PR. But we promise we are here and this seems really awesome. Just don't want you to be concerned if there is a slight lull in review :) |
Yea, more than anything the type of feedback I'd like is if this is the approach people agree with. The amount of Thank you for the prompt response! |
Please let me know what thoughts are, I can rebase/update if necessary. |
oh +1 - I was just wanting this for |
75094e1
to
d641863
Compare
This is my monthly ping! Also - the windows builder failed pretty fantastically, on all kinds of things that don't look like my fault. |
Code is little unreadable with all this |
@LK4D4 although I understand the idea and the reason, I'm not 100% sure we want this (not saying I'm sure we don't want this :P ) |
I personally don't feel a need for this, so I'm a "weak no". |
Different proposal, but just for showing (selected) labels in |
} | ||
|
||
if *size { | ||
*fields = *fields + "z" |
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.
do you need to make sure 'z' isn't already in there?
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.
actually, do you purposely want to allow --fields=cccc
? Guess if that's what the user wants.....
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.
It was my consideration that it could be desired, but doesn't seem in line with what I think a user would suspect. I'll uniq the letters that are set in *fields, choosing the earliest existence.
I actually like the idea and wouldn't mind seeing it on other tabular-output commands. |
I guess before I make more comments on the code we need to exit design review :-) |
I wonder if we only want the shorthand (single-chars) to specify the columns, I can imagine they will be hard to remember without checking the help/man. Perhaps also Would using a comma-separated list be good idea in general (also for single-chars), as it leaves more room for future expansion (I think) |
Still not sure if I want this. But if I did, I agree with @thaJeztah on separating actual words with commas. I don't like the single-chars. Even though unix philosophy would say no to this PR, I agree it's not as easy to awk the output. One could say just use the API though. Maybe there's room for this. I just hope we're not opening a can of worms where people can point to this PR saying "but he got to have his --fields PR merged". |
@tiborvass can you elaborate on why on you think the unix philosophy would say no to this PR? The linx 'ps' command itself has this feature. |
How about just |
* api/client/ps.go: Refactor CmdPs to use a fields list of characters to determine which columns to print on `docker ps` invocation. This adds an ability for the docker command to print the columns of output in arbitrary order. Signed-off-by: Jeff Mickey <j@codemac.net>
What I'd like to see from this:
Use case:
/cc @vieux |
@aluzzardi see 59c4561 |
5ac2690
to
1e11070
Compare
* api/client/ps.go: named label support Signed-off-by: Jeff Mickey <j@codemac.net>
Well, I updated for naming the columns, but not any epic |
As @thaJeztah mentioned, and as we discussed in the maintainers meeting, any effort for custom formatting must:
I really appreciate your PR, it made us aware of some improvements needed in this command. Please, refer to #12931 as it fulfills these two requirements and it also supports what the Swarm team needs. |
@codemac where are we with this? |
@icecrime see #10255 (comment) I really don't care about having any credit in the commit, but we should not deviate from other commands that already support the |
@codemac Did you want to make the suggested changes? |
Ping @docker/core-maintainers: if somebody wants to carry that, I think it's a good time. |
Any ETA of when this will be available? |
I'm going to carry this--sorry for the delay as everything else has come up this week. Of course, it will still require review and merge before it makes its way into master, so no prediction on an actual date. |
Carried in PR #14699 , closing. |
Thanks @estesp! |
Carry #10255: Docker ps format
characters to determine which columns to print on
docker ps
invocation.
This adds an ability for the docker command to print the columns of
output in arbitrary order.
This is nominally related to #7477
Signed-off-by: Jeff Mickey j@codemac.net