Skip to content

Commit

Permalink
du: s/usage_exit/usage/ (#574)
Browse files Browse the repository at this point in the history
* Rename usage function for consistency with other commands
* Passing an exit value is overkill; just exit(1) because 1 is always passed
  • Loading branch information
mknos committed Apr 22, 2024
1 parent f93b431 commit 8bf359b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bin/du
Expand Up @@ -32,13 +32,13 @@ $dirsep = '/'; # Assume '/' is the directory separator
$blocksize = $ENV{BLOCKSIZE} if $ENV{BLOCKSIZE}; # use environment if present

# Process command line options
getopts('HLPacklrsx') or usage_exit(1);
getopts('HLPacklrsx') or usage();

$blocksize = 1024 if $opt_k;

if ($opt_a && $opt_s) {
print STDERR "$0: cannot both summarize and show all entries\n";
usage_exit(1);
usage();
}

# Default to traversing current directory if no files specified
Expand Down Expand Up @@ -96,9 +96,9 @@ sub traverse {
return $total;
}

sub usage_exit {
sub usage {
print STDERR "Usage: $0 [-H | -L | -P] [-a | -s] [-cklrx] [file ...]\n";
exit(@_);
exit 1;
}

=head1 NAME
Expand Down

0 comments on commit 8bf359b

Please sign in to comment.