mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-07-03 18:21:16 -03:00
Let command -q work
This required "-sq" to be used and errored if just "-q" was given. Instead, if only "-q" is given, we behave just as if "-sq" was.
This commit is contained in:
@@ -87,7 +87,8 @@ int builtin_command(parser_t &parser, io_streams_t &streams, wchar_t **argv) {
|
||||
return STATUS_CMD_OK;
|
||||
}
|
||||
|
||||
if (!opts.find_path && !opts.all_paths) {
|
||||
// Quiet implies find_path.
|
||||
if (!opts.find_path && !opts.all_paths && !opts.quiet) {
|
||||
builtin_print_help(parser, streams, cmd, streams.out);
|
||||
return STATUS_INVALID_ARGS;
|
||||
}
|
||||
@@ -101,7 +102,7 @@ int builtin_command(parser_t &parser, io_streams_t &streams, wchar_t **argv) {
|
||||
if (!opts.quiet) streams.out.append_format(L"%ls\n", path.c_str());
|
||||
++found;
|
||||
}
|
||||
} else {
|
||||
} else { // Either find_path explicitly or just quiet.
|
||||
wcstring path;
|
||||
if (path_get_path(command_name, &path, parser.vars())) {
|
||||
if (!opts.quiet) streams.out.append_format(L"%ls\n", path.c_str());
|
||||
|
||||
Reference in New Issue
Block a user