From 4c7876a7b9788e6d2e942acd974bfc968c48ea17 Mon Sep 17 00:00:00 2001 From: ydah <13041216+ydah@users.noreply.github.com> Date: Wed, 25 Oct 2023 13:16:29 +0900 Subject: [PATCH] Change `-h` option from a `--header` short option to a `--help` short option --- lib/lrama/option_parser.rb | 3 +-- spec/lrama/option_parser_spec.rb | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/lrama/option_parser.rb b/lib/lrama/option_parser.rb index 86e48291..b0415cdf 100644 --- a/lib/lrama/option_parser.rb +++ b/lib/lrama/option_parser.rb @@ -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 diff --git a/spec/lrama/option_parser_spec.rb b/spec/lrama/option_parser_spec.rb index 71972c41..7a0f1091 100644 --- a/spec/lrama/option_parser_spec.rb +++ b/spec/lrama/option_parser_spec.rb @@ -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