Skip to content

Commit

Permalink
basename/dirname: exit(1) for no args (#448)
Browse files Browse the repository at this point in the history
* basename: non-zero exit code for no arguments

* dirname: non-zero exit code for no arguments
  • Loading branch information
mknos authored Feb 11, 2024
1 parent 28aaf5f commit 229c940
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions bin/basename
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ unless (@ARGV == 1 || @ARGV == 2) {
$0 = basename ($0);
print <<EOF;
$0 (Perl bin utils) $VERSION
$0 string [suffix | /pattern/]
usage: $0 string [suffix | /pattern/]
EOF
exit;
exit 1;
};

if (@ARGV == 2) {
Expand Down
4 changes: 2 additions & 2 deletions bin/dirname
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ unless (@ARGV == 1) {
$0 = basename ($0);
print <<EOF;
$0 (Perl bin utils) $VERSION
$0 string
usage: $0 string
EOF
exit;
exit 1;
};

print +(dirname $ARGV [0]), "\n";
Expand Down

0 comments on commit 229c940

Please sign in to comment.