about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiForgetExternal.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/LeiForgetExternal.pm')
-rw-r--r--lib/PublicInbox/LeiForgetExternal.pm16
1 files changed, 5 insertions, 11 deletions
diff --git a/lib/PublicInbox/LeiForgetExternal.pm b/lib/PublicInbox/LeiForgetExternal.pm
index 7a4bbcf8..c8d1df38 100644
--- a/lib/PublicInbox/LeiForgetExternal.pm
+++ b/lib/PublicInbox/LeiForgetExternal.pm
@@ -16,14 +16,12 @@ sub lei_forget_external {
                         next if $seen{$l}++;
                         my $key = "external.$l.boost";
                         delete($cfg->{$key});
-                        $lei->_config('--unset', $key);
-                        if ($? == 0) {
+                        if ($lei->_config('+e', '--unset', $key)) {
                                 $lei->qerr("# $l forgotten ");
                         } elsif (($? >> 8) == 5) {
-                                $lei->err("# $l not found");
+                                warn("# $l not found\n");
                         } else {
-                                $lei->err("# --unset $key error");
-                                return $lei->x_it($?);
+                                $lei->child_error($?, "# --unset $key error");
                         }
                 }
         }
@@ -33,14 +31,10 @@ sub lei_forget_external {
 sub _complete_forget_external {
         my ($lei, @argv) = @_;
         my $cfg = $lei->_lei_cfg or return ();
-        my ($cur, $re, $match_cb) = $lei->complete_url_prepare(\@argv);
-        # FIXME: bash completion off "http:" or "https:" when the last
-        # character is a colon doesn't work properly even if we're
-        # returning "//$HTTP_HOST/$PATH_INFO/", not sure why, could
-        # be a bash issue.
+        my ($pfx, $cur, $match_cb) = $lei->complete_url_prepare(\@argv);
         map {
                 $match_cb->(substr($_, length('external.')));
-        } grep(/\Aexternal\.$re\Q$cur/, @{$cfg->{-section_order}});
+        } grep(/\Aexternal\.\Q$pfx$cur/, @{$cfg->{-section_order}});
 }
 
 1;