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

Change -h option from a --header short option to a --help short option #157

Merged
merged 1 commit into from
Oct 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Change -h option from a --header short option to a --help short…
… option
ydah committed Oct 25, 2023
commit 4c7876a7b9788e6d2e942acd974bfc968c48ea17
3 changes: 1 addition & 2 deletions lib/lrama/option_parser.rb
Original file line number Diff line number Diff line change
@@ -61,7 +61,6 @@ def parse_by_option_parser(argv)
o.separator ''
o.separator 'Output:'
o.on('-H', '--header=[FILE]', 'also produce a header file named FILE') {|v| @options.header = true; @options.header_file = v }
o.on('-h=[FILE]', 'also produce a header file named FILE (deprecated)') {|v| @options.header = true; @options.header_file = v }
o.on('-d', 'also produce a header file') { @options.header = true }
o.on('-r', '--report=THINGS', Array, 'also produce details on the automaton') {|v| @report = v }
o.on('--report-file=FILE', 'also produce details on the automaton output to a file named FILE') {|v| @options.report_file = v }
@@ -74,7 +73,7 @@ def parse_by_option_parser(argv)
o.separator ''
o.separator 'Other options:'
o.on('-V', '--version', "output version information and exit") {|v| puts "lrama #{Lrama::VERSION}"; exit 0 }
o.on('--help', "display this help and exit") {|v| puts o; exit 0 }
o.on('-h', '--help', "display this help and exit") {|v| puts o; exit 0 }
o.separator ''
o.parse!(argv)
end
3 changes: 1 addition & 2 deletions spec/lrama/option_parser_spec.rb
Original file line number Diff line number Diff line change
@@ -49,7 +49,6 @@

Output:
-H, --header=[FILE] also produce a header file named FILE
-h=[FILE] also produce a header file named FILE (deprecated)
-d also produce a header file
-r, --report=THINGS also produce details on the automaton
--report-file=FILE also produce details on the automaton output to a file named FILE
@@ -62,7 +61,7 @@

Other options:
-V, --version output version information and exit
--help display this help and exit
-h, --help display this help and exit

HELP
end