Skip to content

Commit

Permalink
Merge pull request #157 from ydah/change-h-option
Browse files Browse the repository at this point in the history
Change `-h` option from a `--header` short option to a `--help` short option
  • Loading branch information
yui-knk authored Oct 25, 2023
2 parents 05d90df + 4c7876a commit 7203468
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions lib/lrama/option_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand All @@ -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
Expand Down
3 changes: 1 addition & 2 deletions spec/lrama/option_parser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 7203468

Please sign in to comment.