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

Adjust output of --help text to mirror command line changes #5334

Merged
merged 3 commits into from Aug 4, 2018

Conversation

Michael0x2a
Copy link
Collaborator

This commit adjusts the output of running mypy --help to mirror the changes made in #5333.

Specifically, it rearranges the order of the flags slightly and replaces the summary of the flags at the top with a short description of how to use mypy along with links for learning more.

This commit adjusts the output of running `mypy --help` to mirror the
changes made in python#5333.

Specifically, it rearranges the order of the flags slightly and replaces
the summary of the flags at the top with a short description of how to
use mypy along with links for learning more.
@Michael0x2a
Copy link
Collaborator Author

For reference, the new output: https://gist.github.com/Michael0x2a/0bdefea47267b59dd7d3810088f88669

Note that it links to a page introduced in #5333.

Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

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

Why not capitalize the first word of every section title? Currently the sections start with lower case words, and they all look funny to me, because they have subtitles that are capitalized. I realize we can't fix that for "usage:" itself, but all the others we control... (Also several of the sections have a section title that's almost the same as the subtitle -- since these always seem to appear together it would be nice if there was less redundancy there.)

While I'm on a capitalization rant, the individual help messages should probably also all be made to start with a capital letter (but not end with a period).

Otherwise LG -- I think the full list of flags has gotten too unwieldy.

mypy/main.py Outdated
@@ -297,6 +294,37 @@ def infer_python_version_and_executable(options: Options,
options.python_executable = special_opts.python_executable


HEADER = """%(prog)s [-h] [-v] [-V] [more options; see below]
[-m MODULE] [-p PACKAGE] [-c PROGRAM_TEXT] [files [files ...]]"""
Copy link
Member

Choose a reason for hiding this comment

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

Isn't [[files [files ...]] redundant? I'd just say [files ...].

@Michael0x2a
Copy link
Collaborator Author

@gvanrossum -- I 100% agree with your comments regarding capitalization -- I was about to do it the way you suggested back when I made my first wave of command line improvements, but reluctantly gave up partly because of things like usage: and partly because it seemed like it went against argparse's conventions.

Anyways, I'll make the fixes you suggested later tonight.

@Michael0x2a
Copy link
Collaborator Author

@gvanrossum -- this is ready for another look. The new help text looks like this:

https://gist.github.com/Michael0x2a/7220f9a088aac51bbe13f9078d521793

Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

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

Love it!

@Michael0x2a Michael0x2a merged commit ee7b511 into python:master Aug 4, 2018
@Michael0x2a Michael0x2a deleted the adjust-help-text branch August 4, 2018 22:47
@Michael0x2a Michael0x2a mentioned this pull request Sep 16, 2018
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants