'by-mid|mid:s' => [ 'MID', 'match only by Message-ID, ignoring contents' ],
'jobs:i' => 'set parallelism level',
+'kw|keywords|flags!' => 'disable/enable importing 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',
my (@vals, @s, @l);
my $x = $sw;
if ($x =~ s/!\z//) { # solve! => --no-solve
- $x = "no-$x";
+ $x =~ s/(\A|\|)/$1no-/g
} elsif ($x =~ s/:.+//) { # optional args: $x = "mid:s"
@vals = (' [', undef, ']');
} elsif ($x =~ s/=.+//) { # required arg: $x = "type=s"
}
puts $self, grep(/$re/, map { # generate short/long names
if (s/[:=].+\z//) { # req/optional args, e.g output|o=i
- } else { # negation: solve! => no-solve|solve
- s/\A(.+)!\z/no-$1|$1/;
+ } elsif (s/!\z//) {
+ # negation: solve! => no-solve|solve
+ s/([\w\-]+)/$1|no-$1/g
}
map {
my $x = length > 1 ? "--$_" : "-$_";
--mua --mua-cmd --no-local --local --verbose -v
--save-as --no-remote --remote --torsocks
--reverse -r )) {
- ok($out{$sw}, "$sw offered as completion");
+ ok($out{$sw}, "$sw offered as `lei q' completion");
}
ok($lei->(qw(_complete lei q --form)), 'complete q --format');
ok($out{$f}, "got $sw $f as output format");
}
}
+ ok($lei->(qw(_complete lei import)), 'complete import');
+ %out = map { $_ => 1 } split(/\s+/s, $out);
+ for my $sw (qw(--flags --no-flags --no-kw --kw --no-keywords
+ --keywords)) {
+ ok($out{$sw}, "$sw offered as `lei import' completion");
+ }
};
my $test_fail = sub {