]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei import|convert: drop --no-kw aliases
authorEric Wong <e@80x24.org>
Thu, 22 Apr 2021 09:08:22 +0000 (07:08 -0200)
committerEric Wong <e@80x24.org>
Thu, 22 Apr 2021 21:05:48 +0000 (17:05 -0400)
Supporting --no-keywords and --no-flags aliases is harmful
if users end up assuming "keywords:" and "flags:" are valid
search prefixes (they're not).

Documentation/lei-import.pod
lib/PublicInbox/LEI.pm
t/lei.t

index acc4f77689f3c5713fd33778232a951b1bfa1a94..7d70191d9af582f41465e7aa08554781443a951c 100644 (file)
@@ -40,7 +40,7 @@ C<none>.
 
 Default: fcntl,dotlock
 
-=item --no-kw, --no-keywords, --no-flags
+=item --no-kw
 
 Don't import message keywords (or "flags" in IMAP terminology).
 
index d9e644ebe637070755815329c24d1a05f3393429..9f49fc038c8881fad6a7a44a988f2e0ccf5f47e3 100644 (file)
@@ -181,7 +181,7 @@ our %CMD = ( # sorted in order of importance/use:
        qw(exact! all jobs:i indexed), @c_opt ],
 
 'add-watch' => [ 'LOCATION', 'watch for new messages and flag changes',
-       qw(import! kw|keywords|flags! interval=s recursive|r
+       qw(import! kw! interval=s recursive|r
        exclude=s include=s), @c_opt ],
 'ls-watch' => [ '[FILTER...]', 'list active watches with numbers and status',
                qw(format|f=s z), @c_opt ],
@@ -193,12 +193,11 @@ our %CMD = ( # sorted in order of importance/use:
 'import' => [ 'LOCATION...|--stdin',
        'one-time import/update from URL or filesystem',
        qw(stdin| offset=i recursive|r exclude=s include|I=s
-       lock=s@ in-format|F=s kw|keywords|flags! verbose|v+
-       incremental!), @c_opt ],
+       lock=s@ in-format|F=s kw! verbose|v+ incremental!), @c_opt ],
 'convert' => [ 'LOCATION...|--stdin',
        'one-time conversion from URL or filesystem to another format',
        qw(stdin| in-format|F=s out-format|f=s output|mfolder|o=s
-       lock=s@ kw|keywords|flags!), @c_opt ],
+       lock=s@ kw!), @c_opt ],
 'p2q' => [ 'FILE|COMMIT_OID|--stdin',
        "use a patch to generate a query for `lei q --stdin'",
        qw(stdin| want|w=s@ uri debug), @c_opt ],
@@ -350,7 +349,7 @@ my %OPTDESC = (
 
 'by-mid|mid:s' => [ 'MID', 'match only by Message-ID, ignoring contents' ],
 
-'kw|keywords|flags!' => 'disable/enable importing flags',
+'kw!' => 'disable/enable importing keywords (aka "flags")',
 
 # xargs, env, use "-0", git(1) uses "-z".  We support z|0 everywhere
 'z|0' => 'use NUL \\0 instead of newline (CR) to delimit lines',
diff --git a/t/lei.t b/t/lei.t
index 6ade2f180198dca246b9c34d7d8af06ce94b77dc..6d276050adedd4138c46b129aaaa5217074d702a 100644 (file)
--- a/t/lei.t
+++ b/t/lei.t
@@ -131,8 +131,7 @@ my $test_completion = sub {
        }
        lei_ok(qw(_complete lei import));
        %out = map { $_ => 1 } split(/\s+/s, $lei_out);
-       for my $sw (qw(--flags --no-flags --no-kw --kw --no-keywords
-                       --keywords)) {
+       for my $sw (qw(--no-kw --kw)) {
                ok($out{$sw}, "$sw offered as `lei import' completion");
        }
 };