]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LEI.pm
lei config --edit: use controlling terminal
[public-inbox.git] / lib / PublicInbox / LEI.pm
index b468a32ca87d5b3cf6e25a95faaf05a370330157..148a5b1e530d00e0ab73d02aa0f214532d28ac0b 100644 (file)
@@ -278,7 +278,7 @@ our %CMD = ( # sorted in order of importance/use:
 'config' => [ '[...]', sub {
                'git-config(1) wrapper for '._config_path($_[0]);
        }, qw(config-file|system|global|file|f=s), # for conflict detection
-        qw(c=s@ C=s@), pass_through('git config') ],
+        qw(edit|e c=s@ C=s@), pass_through('git config') ],
 'inspect' => [ 'ITEMS...|--stdin', 'inspect lei/store and/or local external',
        qw(stdin| pretty ascii dir=s), @c_opt ],
 
@@ -870,14 +870,6 @@ sub _config {
        waitpid(spawn($cmd, \%env, \%rdr), 0);
 }
 
-sub lei_config {
-       my ($self, @argv) = @_;
-       $self->{opt}->{'config-file'} and return fail $self,
-               "config file switches not supported by `lei config'";
-       _config(@_);
-       x_it($self, $?) if $?;
-}
-
 sub lei_daemon_pid { puts shift, $$ }
 
 sub lei_daemon_kill {
@@ -1504,4 +1496,12 @@ sub sto_done_request {
        $lei->err($@) if $@;
 }
 
+sub cfg_dump ($$) {
+       my ($lei, $f) = @_;
+       my $ret = eval { PublicInbox::Config->git_config_dump($f, $lei->{2}) };
+       return $ret if !$@;
+       $lei->err($@);
+       undef;
+}
+
 1;