Skip to content

Commit 0779dfa

Browse files
cbrandtbuffalosunnavy
authored andcommitted
Remove duplicate CLI options
Getopt::Long started warning about duplicate options in version 2.55 and the change notes say it will become a fatal error in a future release.
1 parent 8248b0a commit 0779dfa

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

lib/RT/Interface/CLI.pm

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,15 +189,21 @@ sub Init {
189189
for (@_) {
190190
m/^([a-zA-Z0-9-]+)/;
191191
$exists{$1}++;
192-
push @args, $_ => \($hash->{$1});
192+
# debug is treated specially later
193+
push @args, $_ => \($hash->{$1}) unless $1 eq 'debug';
193194
}
194195
} else {
195196
$hash = {};
196-
@args = @_;
197197
while (@_) {
198198
my $key = shift(@_);
199199
$exists{$key}++;
200-
shift(@_);
200+
# debug is treated specially later
201+
if ( $key eq 'debug' ) {
202+
shift @_;
203+
}
204+
else {
205+
push @args, $key, shift @_;
206+
}
201207
}
202208
}
203209

sbin/rt-setup-database.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ GetOptions(
8282
\%args,
8383
'action=s',
8484
'force', 'debug',
85-
'dba=s', 'dba-password=s', 'prompt-for-dba-password', 'package=s',
85+
'dba=s', 'dba-password=s', 'prompt-for-dba-password',
8686
'datafile=s', 'datadir=s', 'skip-create', 'root-password-file=s',
8787
'package=s', 'ext-version=s',
8888
'upgrade-from=s', 'upgrade-to=s',

0 commit comments

Comments
 (0)