-
-
Notifications
You must be signed in to change notification settings - Fork 73
Description
Migrating from version 1.0 to version 2.0, we noticed that this library has switched to starting descriptions with a lower case letter. For example -h now says show this help message and exit:
$ ./test.js -h
usage: test.js [-h] [-v] [-f FOO] [-b BAR] [--baz BAZ]
Argparse example
optional arguments:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-f FOO, --foo FOO foo bar
-b BAR, --bar BAR bar foo
--baz BAZ baz bar
I understand that this is part of the efforts to more closely mimic the Python implementation of argparse. 👍
And indeed, Python uses short lower case sentence fragments for its own docs:
usage: python [option] ... [-c cmd | -m mod | file | -] [arg] ...
Options and arguments (and corresponding environment variables):
-b : issue warnings about comparing bytearray with unicode
(-bb: issue errors)
-B : don't write .py[co] files on import; also PYTHONDONTWRITEBYTECODE=x
-c cmd : program passed in as string (terminates option list)
-d : debug output from parser; also PYTHONDEBUG=x
-E : ignore PYTHON* environment variables (such as PYTHONPATH)
-h : print this help message and exit (also --help)
-i : inspect interactively after running script; forces a prompt even
if stdin does not appear to be a terminal; also PYTHONINSPECT=x
. . .
HOWEVER, many many many other tools prefer to write more detailed documentation using grammatically complete English sentences. Some popular examples:
tsc:--help, -h Print this message.gcc:-help Display available optionseslint:-h, --help Show helppowershell:-Help, -?, /? Shows this message.webpack:-h, --help [verbose] Display help for commands and options.
Even Python's own package manager uses properly capitalized full sentences:
Usage:
pip <command> [options]
. . .
General Options:
-h, --help Show help.
--debug Let unhandled exceptions propagate outside the main subroutine,
instead of logging them to stderr.
--isolated Run pip in an isolated mode, ignoring environment variables and user
configuration.
--require-virtualenv Allow pip to only run in a virtual environment; exit with an error
otherwise.
Feature request
To support tools that want to adopt maintstream capitalization, it would be great if this library provided a setting to capitalize the first letter of sentences, and generally to provide less terse phrasing of messages.
Or alternatively, maybe the API could provide a general way to customize all of the strings printed by the library, and then we can adjust them however we like. (This might also provide a simple mechanism for localization.)