aboutsummaryrefslogtreecommitdiff
path: root/checkem
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-08-09 15:11:16 +1200
committerTom Ryder <tom@sanctum.geek.nz>2017-08-09 15:11:26 +1200
commit29ad615174fb0faa0d89008b9e9e0567db60033a (patch)
tree764544df99b3c3a636860ce2b348208d8b211cf1 /checkem
parentSlightly better package name (diff)
downloadcheckem-29ad615174fb0faa0d89008b9e9e0567db60033a.tar.gz
checkem-29ad615174fb0faa0d89008b9e9e0567db60033a.zip
Categorise missing arg as usage error
Rather than a croak exception. Also exit with "2", like shell utils often do when misused rather than broken.
Diffstat (limited to 'checkem')
-rwxr-xr-xcheckem6
1 files changed, 5 insertions, 1 deletions
diff --git a/checkem b/checkem
index b58ccbb..2181fca 100755
--- a/checkem
+++ b/checkem
@@ -27,7 +27,11 @@ use 5.009003;
our $VERSION = 2.5;
# If no arguments, work with the current working directory
-croak 'Need at least one dir to search' if !@ARGV;
+if ( !@ARGV ) {
+ say {*STDERR} 'Need at least one dir to search'
+ or carp 'Failed stderr write';
+ exit 2;
+}
# Convenience keys into stat() return array for clarity and to appease
# Perl::Critic