summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/stow.in2
-rwxr-xr-x[-rw-r--r--]t/cli.t6
2 files changed, 6 insertions, 2 deletions
diff --git a/bin/stow.in b/bin/stow.in
index 98b576e..adff6de 100755
--- a/bin/stow.in
+++ b/bin/stow.in
@@ -539,7 +539,7 @@ sub process_options {
push @pkgs_to_stow, $_[0];
}
},
- ) or usage();
+ ) or usage('');
usage() if $options{help};
version() if $options{version};
diff --git a/t/cli.t b/t/cli.t
index 0fc0528..010fc79 100644..100755
--- a/t/cli.t
+++ b/t/cli.t
@@ -8,7 +8,7 @@ use strict;
use warnings;
use File::Basename;
-use Test::More tests => 1;
+use Test::More tests => 3;
use testutil;
@@ -47,4 +47,8 @@ my $STOW = 'bin/stow';
`$STOW --help`;
is($?, 0, "--help should return 0 exit code");
+my $err = `$STOW --foo 2>&1`;
+is($? >> 8, 1, "unrecognised option should return 1 exit code");
+like($err, qr/^Unknown option: foo$/m, "unrecognised option should be listed");
+
# vim:ft=perl