]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/MdirReader.pm
lei export-kw: new command to export keywords to Maildirs
[public-inbox.git] / lib / PublicInbox / MdirReader.pm
index 7a0641fb07f287fe8a9ff17127c3041b5428b3fe..304be63d630391c9c36c09c16c19523cb920722f 100644 (file)
@@ -86,4 +86,18 @@ sub maildir_each_eml {
 
 sub new { bless {}, __PACKAGE__ }
 
+sub flags2kw ($) {
+       my @unknown;
+       my %kw;
+       for (split(//, $_[0])) {
+               my $k = $c2kw{$_};
+               if (defined($k)) {
+                       $kw{$k} = 1;
+               } else {
+                       push @unknown, $_;
+               }
+       }
+       (\%kw, \@unknown);
+}
+
 1;