Skip to content

Commit fbc5eb9

Browse files
author
Chris White
committed
Bugfix: option values required [minor]
Fix Getopt::Long specifications to require arguments where appropriate.
1 parent 514f077 commit fbc5eb9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/XML/Axk/App.pm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ my %CMDLINE_OPTS = (
4747
#INCLUDE => ['i','|include=s@'],
4848
#KEEP_GOING => ['k','|keep-going',false], #not in gawk
4949
#LIB => ['l','|load=s@'],
50-
LANGUAGE => ['L','|language:s'],
50+
LANGUAGE => ['L','|language=s'],
5151
# --man reserved
5252
# OUTPUT_FILENAME => ['o','|output=s', ""], # conflict with gawk
5353
# OPTIMIZE => ['O','|optimize'],
5454
#SANDBOX => ['S','|sandbox',false],
5555
#SOURCES reserved
5656
# --usage reserved
5757
PRINT_VERSION => ['version','', false],
58-
DEFS => ['v','|var:s%'],
58+
DEFS => ['v','|var=s%'],
5959
# -? reserved
6060
#
6161
# gawk(1) long options: --dump-variables, --exec, --gen-po, --lint,
@@ -64,7 +64,7 @@ my %CMDLINE_OPTS = (
6464
# Long-only options that are specific to axk.
6565
NO_INPUT => ['no-input'], # When set, don't read any files. This is so
6666
# testing with empty inputs is easier.
67-
SHOW => ['show',':s@'], # which debugging output to print.
67+
SHOW => ['show','=s@'], # which debugging output to print.
6868
# TODO make it a hash instead?
6969
);
7070

@@ -143,7 +143,7 @@ sub Main {
143143

144144
# Treat the first non-option arg as a script if appropriate
145145
unless(@{$opts{SOURCES}}) {
146-
croak "No scripts to run" unless @$lrArgs;
146+
die "No scripts to run" unless @$lrArgs;
147147
push @{$opts{SOURCES}}, [false, shift @$lrArgs];
148148
}
149149

0 commit comments

Comments
 (0)