From d584fc9176bd9cc18bd70eb99ccecb682c1003bd 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 --- 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 875a3481385..99487a0f638 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.34.1