mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-07 18:21:16 -03:00
Correctly implement and --help and or --help
This commit is contained in:
@@ -66,7 +66,11 @@ RESOLVE(job_list) {
|
|||||||
|
|
||||||
// A job decorator is AND or OR
|
// A job decorator is AND or OR
|
||||||
RESOLVE(job_decorator) {
|
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) {
|
switch (token1.keyword) {
|
||||||
case parse_keyword_and: {
|
case parse_keyword_and: {
|
||||||
|
|||||||
@@ -70,3 +70,32 @@ end
|
|||||||
# CHECK: 2
|
# CHECK: 2
|
||||||
# CHECK: 3
|
# CHECK: 3
|
||||||
# CHECK: 4
|
# 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
|
||||||
|
|||||||
Reference in New Issue
Block a user