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

add indication that an option takes a value to the help message #15

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

djerius
Copy link

@djerius djerius commented Dec 3, 2022

The help message didn't specify that an option took a value.

Here's before and after for the option specification in t/11-usage.t

Usage: 11-usage.t [-rv] [long options] [arguments]
	--bare
	--define                 (default: arch=i386, isize=4)
	--input                  (default: test.txt)
	--libs                   (default: one, two)
	-r                       recursive
	--test                   run in test mode
	-v, --verbose            turn on verbose output (default: 2)

Usage: 11-usage.t [-rv] [long options] [arguments]
	--bare <value>
	--define key=<value>     (default: arch=i386, isize=4)
	--input <value>          (default: test.txt)
	--libs <value>           (default: one, two)
	-r                       recursive
	--test                   run in test mode
	-v [<value>], --verbose [<value>] turn on verbose output (default: 2)

1. correct determination of width of left help column; make leading indent

  * A bug resulted in taking the width of a stringified array reference,
    rather than the data in the array.

  * The leading indent was a full tab, which is a lot of space. Reduce
    it to 4 spaces.

2. The help message didn't specify that an option took a value.

Here's before and after for the option specification in t/11-usage.t

Usage: 11-usage.t [-rv] [long options] [arguments]
	--bare
	--define                 (default: arch=i386, isize=4)
	--input                  (default: test.txt)
	--libs                   (default: one, two)
	-r                       recursive
	--test                   run in test mode
	-v, --verbose            turn on verbose output (default: 2)

Usage: 11-usage.t [-rv] [long options] [arguments]
    --bare <value>
    --define key=<value>                 (default: arch=i386, isize=4)
    --input <value>                      (default: test.txt)
    --libs <value>                       (default: one, two)
    -r                                   recursive
    --test                               run in test mode
    -v [<value>], --verbose [<value>]    turn on verbose output (default: 2)
@djerius
Copy link
Author

djerius commented Dec 3, 2022

Fixed the weird output of the last line in the help output; turns out the max width was being incorrectly calculated. Here's what it looks like now:

Usage: 11-usage.t [-rv] [long options] [arguments]
    --bare <value>                       
    --define key=<value>                 (default: arch=i386, isize=4)
    --input <value>                      (default: test.txt)
    --libs <value>                       (default: one, two)
    -r                                   recursive
    --test                               run in test mode
    -v [<value>], --verbose [<value>]    turn on verbose output (default: 2)

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.

1 participant