From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id E001B1FD47 for ; Sun, 2 Feb 2020 06:52:23 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 6/9] convert: shift @ARGV explicitly Date: Sun, 2 Feb 2020 06:52:19 +0000 Message-Id: <20200202065222.14966-7-e@yhbt.net> In-Reply-To: <20200202065222.14966-1-e@yhbt.net> References: <20200202065222.14966-1-e@yhbt.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Relying on implicit "@_" for shift fails with TestCommon::_run_sub iff GetOptions modifies @ARGV. --- script/public-inbox-convert | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/public-inbox-convert b/script/public-inbox-convert index acecf3d5..281313e0 100755 --- a/script/public-inbox-convert +++ b/script/public-inbox-convert @@ -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 };