Skip to content

Commit 229df32

Browse files
authored
units: unused variable (#590)
* Remove $read_unittab from read_unittab() * Also, call usage() directly in process_args() so the variable $USAGE is no longer needed
1 parent de9c097 commit 229df32

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

bin/units

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,6 @@ sub process_args {
135135
my( $class, @args ) = @_;
136136

137137
my @unittabs;
138-
my $USAGE;
139-
140138
while (@args and $args[0] =~ /^-/) {
141139
my $flag = shift @args;
142140
if ($flag =~ /^-(f|-file)?$/) {
@@ -146,11 +144,11 @@ sub process_args {
146144
exit 0;
147145
} else {
148146
warn "Unknown flag: $flag.\n";
149-
$USAGE++;
147+
$class->usage();
150148
}
151149
}
152150

153-
$class->usage() if $USAGE || @args == 1 || @args > 2;
151+
$class->usage() if @args == 1 || @args > 2;
154152

155153
@unittabs = $class->env_unittabs unless @unittabs;
156154
@unittabs = $class->default_unittabs unless @unittabs;
@@ -160,7 +158,6 @@ sub process_args {
160158

161159
sub read_unittab {
162160
my( $class, $file ) = @_;
163-
my $read_unittab = 0;
164161

165162
my( $name, $fh ) = do {
166163
if( defined $file and -e $file ) {

0 commit comments

Comments
 (0)