X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=script%2Fpublic-inbox-edit;h=1fbaf5a7d11c19e5759b8a59073de2aa7772876f;hb=78bb0db52870deeb72b0488d78dd97ddb253f4c8;hp=81f023bca1873e87491dddcfc141a006beb9e309;hpb=8862c33ae93eea1af6246cd3c7a81e0a122186bf;p=public-inbox.git
diff --git a/script/public-inbox-edit b/script/public-inbox-edit
index 81f023bc..1fbaf5a7 100755
--- a/script/public-inbox-edit
+++ b/script/public-inbox-edit
@@ -1,5 +1,5 @@
#!/usr/bin/perl -w
-# Copyright (C) 2019-2020 all contributors
+# Copyright (C) 2019-2021 all contributors
# License: AGPL-3.0+
#
# Used for editing messages in a public-inbox.
@@ -33,9 +33,10 @@ See public-inbox-edit(1) man page for full documentation.
EOF
my $opt = { verbose => 1, all => 0, -min_inbox_version => 2, raw => 0 };
-my @opt = qw(mid|m=s file|F=s raw);
+my @opt = qw(mid|m=s file|F=s raw C=s@);
GetOptions($opt, @PublicInbox::AdminEdit::OPT, @opt) or die $help;
if ($opt->{help}) { print $help; exit 0 };
+PublicInbox::Admin::do_chdir(delete $opt->{C});
my $cfg = PublicInbox::Config->new;
my $editor = $ENV{MAIL_EDITOR}; # e.g. "mutt -f"
@@ -133,7 +134,7 @@ $mids
}
my %tmpopt = (
- TEMPLATE => 'public-inbox-edit-XXXXXX',
+ TEMPLATE => 'public-inbox-edit-XXXX',
TMPDIR => 1,
SUFFIX => $opt->{raw} ? '.eml' : '.mbox',
);