mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-01-19 19:32:45 +08:00
Correctly implement and --help and or --help
This commit is contained in:
parent
962bfa9668
commit
fa6bac1283
|
@ -66,7 +66,11 @@ RESOLVE(job_list) {
|
|||
|
||||
// A job decorator is AND or OR
|
||||
RESOLVE(job_decorator) {
|
||||
UNUSED(token2);
|
||||
// If it's followed by --help, it's not a decoration.
|
||||
if (token2.is_help_argument) {
|
||||
*out_tag = parse_bool_none;
|
||||
return production_for<empty>();
|
||||
}
|
||||
|
||||
switch (token1.keyword) {
|
||||
case parse_keyword_and: {
|
||||
|
|
|
@ -70,3 +70,32 @@ end
|
|||
# CHECK: 2
|
||||
# CHECK: 3
|
||||
# CHECK: 4
|
||||
|
||||
# --help works
|
||||
builtin and --help >/dev/null
|
||||
echo $status
|
||||
and --help >/dev/null
|
||||
echo $status
|
||||
# CHECK: 0
|
||||
# CHECK: 0
|
||||
|
||||
builtin and --help >/dev/null
|
||||
echo $status
|
||||
and --help >/dev/null
|
||||
echo $status
|
||||
# CHECK: 0
|
||||
# CHECK: 0
|
||||
|
||||
builtin or --help >/dev/null
|
||||
echo $status
|
||||
or --help >/dev/null
|
||||
echo $status
|
||||
# CHECK: 0
|
||||
# CHECK: 0
|
||||
|
||||
builtin not --help >/dev/null
|
||||
echo $status
|
||||
not --help >/dev/null
|
||||
echo $status
|
||||
# CHECK: 0
|
||||
# CHECK: 0
|
||||
|
|
Loading…
Reference in New Issue
Block a user