From bb9f7b5558707455b4fb3c3a68b47c33a30aa34c Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 4 Oct 2023 15:02:08 +0200 Subject: [PATCH] Bug 28688: Use pod2usage for incorrect usage Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi --- misc/cronjobs/membership_expiry.pl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/misc/cronjobs/membership_expiry.pl b/misc/cronjobs/membership_expiry.pl index 875a348138..99487a0f63 100755 --- a/misc/cronjobs/membership_expiry.pl +++ b/misc/cronjobs/membership_expiry.pl @@ -209,10 +209,12 @@ $letter_renew = 'MEMBERSHIP_RENEWED' if !$letter_renew; pod2usage( -verbose => 2 ) if $man; pod2usage(1) if $help || !$confirm; -if ( defined($active) && defined($inactive) ) { - print "Sorry, it is not possible to pass both -active as well as -inactive.\n"; - exit; -} + +pod2usage( + -verbose => 1, + -msg => q{The --active and --inactive flags are mutually exclusive}, + -exitval => 1 +) if defined $active && defined $inactive; cronlogaction({ info => $command_line_options }); -- 2.39.5