Skip to content

Commit

Permalink
Issue #480: check whether option parsing worked
Browse files Browse the repository at this point in the history
  • Loading branch information
bschmalhofer committed Sep 28, 2020
1 parent cf67ff4 commit 793f88e
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions bin/otobo.SetPermissions.pl
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@

my $ExitStatus = 0;

sub PrintUsage {
my ($DefaultGroupNames) = @_;
sub PrintUsageAndExit {
my ($DefaultGroupNames, $ExitCode) = @_;

print <<"END_USAGE";
Expand All @@ -94,7 +94,7 @@ sub PrintUsage {
END_USAGE

return;
exit $ExitCode;
}

sub Run {
Expand Down Expand Up @@ -139,12 +139,10 @@ sub Run {
'dry-run' => \$DryRun,
'skip-article-dir' => \$SkipArticleDir,
'skip-regex=s' => \@SkipRegex,
);
) or PrintUsageAndExit(\%DefaultGroupNames, 1);

if ( $Help ) {
PrintUsage(\%DefaultGroupNames);

exit 0;
PrintUsageAndExit(\%DefaultGroupNames, 0);
}

if ( $> != 0 ) { # $EFFECTIVE_USER_ID
Expand Down

0 comments on commit 793f88e

Please sign in to comment.