]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei_input: provide hint for bare "L:" and "kw:"
authorEric Wong <e@80x24.org>
Wed, 8 Sep 2021 19:03:59 +0000 (19:03 +0000)
committerEric Wong <e@80x24.org>
Thu, 9 Sep 2021 04:50:34 +0000 (04:50 +0000)
I just made this mistake running "lei import" myself, so
I figure giving a hint makes sense, here.

lib/PublicInbox/LeiInput.pm

index cb71e97c3d2b649db7030f6ed95184c78a9c9445..8ce445c80d07b3748c8828e63f1d55db8aefb28d 100644 (file)
@@ -276,7 +276,10 @@ sub prepare_inputs { # returns undef on error
                                $may_sync and $input = 'maildir:'.
                                                $lei->abs_path($input_path);
                        } else {
-                               return $lei->fail("Unable to handle $input");
+                               my $m = "Unable to handle $input";
+                               $input =~ /\A(?:L|kw):/ and
+                                       $m .= ", did you mean +$input?";
+                               return $lei->fail($m);
                        }
                } elsif ($input =~ /\.(?:eml|patch)\z/i && -f $input) {
                        lc($in_fmt//'eml') eq 'eml' or return $lei->fail(<<"");