mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-15 23:22:53 +08:00
string: Allow -eq
again
Instead of forbidding it for both modes, allow it for both and make it quiet for string. Fixes #6282
This commit is contained in:
parent
6fb7f9b6b8
commit
d77c465d23
@ -750,7 +750,7 @@ class pcre2_matcher_t : public string_matcher_t {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (opts.entire) {
|
if (opts.entire && !opts.quiet) {
|
||||||
streams.out.append(arg);
|
streams.out.append(arg);
|
||||||
streams.out.push_back(L'\n');
|
streams.out.push_back(L'\n');
|
||||||
}
|
}
|
||||||
@ -864,12 +864,6 @@ static int string_match(parser_t &parser, io_streams_t &streams, int argc, wchar
|
|||||||
return STATUS_INVALID_ARGS;
|
return STATUS_INVALID_ARGS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (opts.entire && opts.quiet) {
|
|
||||||
streams.err.append_format(BUILTIN_ERR_COMBO2, cmd,
|
|
||||||
_(L"--entire and --quiet are mutually exclusive"));
|
|
||||||
return STATUS_INVALID_ARGS;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::unique_ptr<string_matcher_t> matcher;
|
std::unique_ptr<string_matcher_t> matcher;
|
||||||
if (opts.regex) {
|
if (opts.regex) {
|
||||||
matcher = make_unique<pcre2_matcher_t>(cmd, pattern, opts, streams);
|
matcher = make_unique<pcre2_matcher_t>(cmd, pattern, opts, streams);
|
||||||
|
@ -561,5 +561,9 @@ count (dualcollect)
|
|||||||
# CHECK: 3
|
# CHECK: 3
|
||||||
|
|
||||||
string match -qer asd asd
|
string match -qer asd asd
|
||||||
# CHECKERR: match: Invalid combination of options,
|
echo $status
|
||||||
# CHECKERR: --entire and --quiet are mutually exclusive
|
# CHECK: 0
|
||||||
|
|
||||||
|
string match -eq asd asd
|
||||||
|
echo $status
|
||||||
|
# CHECK: 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user