about summary refs log tree commit homepage
path: root/script/public-inbox-convert
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-08-10 02:12:04 +0000
committerEric Wong <e@yhbt.net>2020-08-10 06:26:25 +0000
commit555b33881e340bb65808eaf3f2d334f08b0c6246 (patch)
tree84a33b20a8057655ab119fd5a7535ccd58288c49 /script/public-inbox-convert
parent3c90d6a62533f87bc865f02fb6df78577c4f0b89 (diff)
downloadpublic-inbox-555b33881e340bb65808eaf3f2d334f08b0c6246.tar.gz
Instead of silently ignoring excessive args, don't let a user
specify an extra directory.  Furthermore, we'll support the odd
case where BOFH wants to name an $INBOX_DIR to be `0' :P
Diffstat (limited to 'script/public-inbox-convert')
-rwxr-xr-xscript/public-inbox-convert5
1 files changed, 3 insertions, 2 deletions
diff --git a/script/public-inbox-convert b/script/public-inbox-convert
index c9075207..275857fa 100755
--- a/script/public-inbox-convert
+++ b/script/public-inbox-convert
@@ -45,8 +45,9 @@ GetOptions($opt, qw(jobs|j=i index! help|?),
 bad command-line args\n$usage
 EOF
 if ($opt->{help}) { print $help; exit 0 };
-my $old_dir = shift(@ARGV) or die $usage;
-my $new_dir = shift(@ARGV) or die $usage;
+my $old_dir = shift(@ARGV) // '';
+my $new_dir = shift(@ARGV) // '';
+die $usage if (scalar(@ARGV) || $new_dir eq '' || $old_dir eq '');
 die "$new_dir exists\n" if -d $new_dir;
 die "$old_dir not a directory\n" unless -d $old_dir;