]> Sergey Matveev's repositories - public-inbox.git/commitdiff
convert: shift @ARGV explicitly
authorEric Wong <e@yhbt.net>
Sun, 2 Feb 2020 06:52:19 +0000 (06:52 +0000)
committerEric Wong <e@yhbt.net>
Sun, 2 Feb 2020 17:29:56 +0000 (17:29 +0000)
Relying on implicit "@_" for shift fails with
TestCommon::_run_sub iff GetOptions modifies @ARGV.

script/public-inbox-convert

index acecf3d54ed5db44b5aa585fe4e939a8f52e5aac..281313e02873fb7bd7aa27ba8fcc5dbd0e2c188f 100755 (executable)
@@ -19,8 +19,8 @@ my %opts = (
        '--index!' => \$index,
 );
 GetOptions(%opts) or die "bad command-line args\n$usage";
-my $old_dir = shift or die $usage;
-my $new_dir = shift or die $usage;
+my $old_dir = shift(@ARGV) or die $usage;
+my $new_dir = shift(@ARGV) or die $usage;
 die "$new_dir exists\n" if -d $new_dir;
 die "$old_dir not a directory\n" unless -d $old_dir;
 my $config = eval { PublicInbox::Config->new };