Skip to content

Commit

Permalink
Merge pull request #374 from mknos/apply-needarg
Browse files Browse the repository at this point in the history
apply: argument required after command
  • Loading branch information
briandfoy authored Dec 13, 2023
2 parents b53eccb + c052484 commit 4897473
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions bin/apply
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ License: perl


use strict;
use warnings;

use constant EX_SUCCESS => 0;
use constant EX_FAILURE => 1;

my ($VERSION) = '1.2';

Expand All @@ -24,7 +26,7 @@ sub usage () {
$0 (Perl bin utils) $VERSION
$0 [-ac] [-#] command argument [argument ...]
EOF
exit;
exit EX_FAILURE;
};

my $argc = 1;
Expand All @@ -51,9 +53,8 @@ while (@ARGV) {
last;
}

usage unless @ARGV;

my $command = shift;
usage() unless @ARGV;

# Scan $command for ``%d''.
my @thingies = $command =~ /${magic}(\d+)/g;
Expand All @@ -80,6 +81,7 @@ while (@ARGV && @ARGV >= $argc) {
}
}
}
exit EX_SUCCESS;

__END__
Expand Down

0 comments on commit 4897473

Please sign in to comment.