Skip to content
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

Consistent subcommand order #3608

Closed
jorgeorpinel opened this issue Apr 7, 2020 · 6 comments · Fixed by #3626
Closed

Consistent subcommand order #3608

jorgeorpinel opened this issue Apr 7, 2020 · 6 comments · Fixed by #3626
Labels
enhancement Enhances DVC p3-nice-to-have It should be done this or next sprint

Comments

@jorgeorpinel
Copy link
Contributor

Help output of commands with subcommands have a seemingly random order. I propose this (matches docs repo nav sidebar per iterative/dvc.org/pull/1110):

metrics: add, modify, show, diff, remove
pipeline: list, show
remote: add, default, modify, list, remove

I can probably send the PR too 🙂 lmk

@jorgeorpinel jorgeorpinel added the enhancement Enhances DVC label Apr 7, 2020
@jorgeorpinel jorgeorpinel changed the title consistent subcommand order Consistent subcommand order Apr 7, 2020
@skshetry
Copy link
Member

skshetry commented Apr 8, 2020

@jorgeorpinel, the order of the subcommands can be changed by changing the order of the add_parser calls. However, it's easy to mess things up (eg: someone adds a subcommand, etc) and is fragile and hackish. We could extend HelpFormatter to sort those subcommands, but, I don't think it's worth investing time in doing this at all.

@efiop efiop added the p3-nice-to-have It should be done this or next sprint label Apr 8, 2020
@jorgeorpinel
Copy link
Contributor Author

jorgeorpinel commented Apr 8, 2020

Maybe not from a technical point of view but from a user experience perspective, these details can make a significant difference.

i.e. let't put ourselves in the shoes of the user, not of the developer 🙂

@efiop
Copy link
Contributor

efiop commented Apr 10, 2020

Changing the order in the code is the only sane way to go here. And it is extremely simple to create a PR for it. @jorgeorpinel Please feel free to adjust it to your liking.

@efiop
Copy link
Contributor

efiop commented Apr 10, 2020

But as @skshetry mentioned, we provide no guarantees that we won't mess up the order in the future, because it is extremely easy to do that. So maybe not worth bothering at all. We have it sorted in docs - great, but in cli user never sees help for those together so won't ever notice the inconsistency. Your call @jorgeorpinel

@jorgeorpinel

This comment has been minimized.

@jorgeorpinel
Copy link
Contributor Author

jorgeorpinel commented Apr 17, 2020

Looks like I have time for this now yay (will planning to include it in #3626).

  • I also noticed the order of the options in each command help output comes from the order of each parser.add_argument( call. In docs we reordered the options arbitrarily according to which ones we think are more common or important. It would be nice to also match these... But probably for a separate issue UPDATE: Extracted to Consistent cmd option order? #3642

jorgeorpinel added a commit that referenced this issue Apr 17, 2020
efiop pushed a commit that referenced this issue Apr 18, 2020
* add: -f arg name from FILE to <filename>
to match dvc.org cmd ref

* dvc: cmd arg names (metavars) to match docs
for #3626

* metrics: update help output to indicate supported types
per #3409
and for #3572

* dvc: reorder subcommands to match docs
for #3608
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhances DVC p3-nice-to-have It should be done this or next sprint
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants