-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
doc: Added information on --indent to --help #2504
Conversation
Since --indent requires an argument, an argument should be mentioned in usage(). Following the manual, The larger point here is that documenting all the options in usage() in this manner would increase the size of the executable quite a lot, and goes against the idea of keeping the executable small by providing details online. I would propose that usage() simply provide a synopsis of all the options (in the usual man page style), leaving the descriptive details of the options to the online documentation. |
@pkoppstein the patch was already amended 12 hours before your comment to include |
@EvanCarroll - You apparently overlooked the phrase “ … documenting all the options in usage() …”. (The screen I was looking at only showed the line without the “n”.) |
I would not worry about binary size either, possibly that the text is getting long, but maybe then we should cut down on some other usage text instead? maybe the stuff about IEEE754 numbers etc |
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.
I'm not worried about the executable size due to this help, we should list all the option #2284 (we should rather consider replace the builtins by C-coded internals). The only concern about this PR is about the newline in the description; can Bash's _parse_help
parse this form?
Looks OK. $ _parse_help jq -h | xargs
-c -n -e -s -r -R -C -M -S --tab --arg --argjson --slurpfile --rawfile --args --jsonargs --
$ _parse_help ./jq -h | xargs
-c -n -e -s -r -R -C -M -S --tab --indent --arg --argjson --slurpfile --rawfile --args --jsonargs -- |
@@ -81,6 +81,8 @@ static void usage(int code, int keep_it_short) { | |||
" -M monochrome (don't colorize JSON);\n" | |||
" -S sort keys of objects on output;\n" | |||
" --tab use tabs for indentation;\n" | |||
" --indent n use $n spaces for indentation.\n" | |||
" between -1 (default of 4 spaces) and 7;\n" |
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.
Oops, -1
is not 4 spaces
, but the tab character.
Simple doc patch when I noticed functionality I already need was there just undocumented.