mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-07-02 09:11:15 -03:00
Remove trailing ", " in functions output
When executed interactively and not piped, `functions` adds a comma as a separator between each result. This removes the separator after the last item.
This commit is contained in:
@@ -372,6 +372,11 @@ int builtin_functions(parser_t &parser, io_streams_t &streams, wchar_t **argv) {
|
||||
buff.append(name);
|
||||
buff.append(L", ");
|
||||
}
|
||||
if (names.size() > 0) {
|
||||
// Trim trailing ", "
|
||||
buff.resize(buff.size() - 2, '\0');
|
||||
}
|
||||
|
||||
streams.out.append(reformat_for_screen(buff, termsize_last()));
|
||||
} else {
|
||||
for (const auto &name : names) {
|
||||
|
||||
Reference in New Issue
Block a user