diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-08-09 15:11:16 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-08-09 15:11:26 +1200 |
commit | 29ad615174fb0faa0d89008b9e9e0567db60033a (patch) | |
tree | 764544df99b3c3a636860ce2b348208d8b211cf1 /checkem | |
parent | Slightly better package name (diff) | |
download | checkem-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-x | checkem | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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 |