Skip to content

Do not show global options for subcommands by default #4433

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

Closed
wants to merge 4 commits into from

Conversation

techtonik
Copy link
Contributor

Rebased #3319, which got bitrotten.

'list -h' help is too long to fit one screen, so this PR omits global options for subcommands help unless explicitly requested with --verbose flag.

@xavfernandez
Copy link
Member

I'm personnaly -0 on this.
I don't feel having more than one page is a real issue and I'm quite unaware of any other CLI with a --help --verbose pattern.

@pfmoore
Copy link
Member

pfmoore commented Apr 10, 2017

I agree with @xavfernandez. Lots of programs have long help texts. Typically, the solution is for the user to pipe the help through a pager. IMO, doing what other programs do is more discoverable than hiding a chunk of our help behind an unconventional --verbose flag.

@techtonik
Copy link
Contributor Author

@xavfernandez Mercurial, obviously, cares about user experience, so they do provide this command. The rationale is to filter important level 1 stuff for user rather than leaving him to grasp through the mess himself. Back in 19xx people have plenty of time to read manuals with all irrelevant info, but in the age of StackOverflow it is just annoying.

@cjerdonek
Copy link
Member

FWIW, the setup.py command does something similar with its help invocation, with its more verbose incarnation called --help-commands:

$ python setup.py --help
Common commands: (see '--help-commands' for more)

  setup.py build      will build the package underneath 'build/'
  setup.py install    will install the package

Global options:
  --verbose (-v)      run verbosely (default)
  --quiet (-q)        run quietly (turns verbosity off)
...

@pradyunsg
Copy link
Member

Personally, I find it easier to just pass it the help command through a pager.

I'd argue it's better to expect people to just run !! | page if some output is too long.

@techtonik
Copy link
Contributor Author

Rebasing old commits. Problems with !! | page is that it is non-cross platform.

@pradyunsg pradyunsg added type: enhancement Improvements to functionality state: needs discussion This needs some more discussion labels Jul 21, 2017
@@ -31,6 +31,6 @@ def run(self, options, args):
raise CommandError(' - '.join(msg))

command = commands_dict[cmd_name]()
command.parser.print_help()
command.print_help()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe pass verbose=True here? or even options.verbose?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. but I forgot how to run pip from checkout. Rebased here - #5746

@pradyunsg
Copy link
Member

pradyunsg commented Jul 21, 2017

it is non-cross platform.

Fair enough. But there would some pager on your system...

Anyway, FWIW, I'm a +0 on this.

@BrownTruck
Copy link
Contributor

Hello!

I am an automated bot and I have noticed that this pull request is not currently able to be merged. If you are able to either merge the master branch into this pull request or rebase this pull request against master then it will eligible for code review and hopefully merging!

@BrownTruck BrownTruck added the needs rebase or merge PR has conflicts with current master label Sep 1, 2017
@pradyunsg
Copy link
Member

Is there still interest in this?

@pradyunsg pradyunsg added the S: awaiting response Waiting for a response/more information label May 11, 2018
@techtonik
Copy link
Contributor Author

There is interest, but no time.

@pradyunsg pradyunsg removed S: awaiting response Waiting for a response/more information state: needs discussion This needs some more discussion needs rebase or merge PR has conflicts with current master labels May 13, 2018
@pradyunsg
Copy link
Member

I'll close this PR and open a tracking issue.

@pradyunsg pradyunsg closed this May 13, 2018
@pradyunsg
Copy link
Member

(hopefully, nobody minds)

@lock
Copy link

lock bot commented Jun 1, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 1, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation type: enhancement Improvements to functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants