mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-04 15:41:12 -03:00
functions -q: Return false without an argument
This erroneously listed functions and returned true.
This commit is contained in:
@@ -337,6 +337,11 @@ int builtin_functions(parser_t &parser, io_streams_t &streams, wchar_t **argv) {
|
||||
return STATUS_CMD_OK;
|
||||
}
|
||||
|
||||
// If we query with no argument, just return false.
|
||||
if (opts.query && argc == optind) {
|
||||
return STATUS_CMD_ERROR;
|
||||
}
|
||||
|
||||
if (opts.list || argc == optind) {
|
||||
wcstring_list_t names = function_get_names(opts.show_hidden);
|
||||
std::sort(names.begin(), names.end());
|
||||
|
||||
Reference in New Issue
Block a user