From add90b9504f4217af5e35b3be7e326b8c6419647 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 15 Sep 2021 21:35:59 +0000 Subject: support -C (chdir) for most non-daemon commands Because make(1), git(1), tar(1) all support -C in this form, as do our newer commands such as lei, public-inbox-{clone,fetch}. --- script/public-inbox-edit | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'script/public-inbox-edit') diff --git a/script/public-inbox-edit b/script/public-inbox-edit index 9498038b..1fbaf5a7 100755 --- a/script/public-inbox-edit +++ b/script/public-inbox-edit @@ -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" -- cgit v1.2.3-24-ge0c7