mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-15 15:05:27 +08:00
builtin time: print help on invalid syntax
I always mix up the order with variable assignments.
This commit is contained in:
parent
9eb2649319
commit
5ff2d38d4c
@ -39,3 +39,12 @@ Example
|
||||
Executed in 3,01 secs fish external
|
||||
usr time 9,16 millis 2,94 millis 6,23 millis
|
||||
sys time 0,23 millis 0,00 millis 0,23 millis
|
||||
|
||||
Inline variable assignments need to follow the ``time`` keyword::
|
||||
|
||||
>_ time a_moment=1.5m sleep $a_moment
|
||||
|
||||
________________________________________________________
|
||||
Executed in 90.00 secs fish external
|
||||
usr time 4.62 millis 4.62 millis 0.00 millis
|
||||
sys time 2.35 millis 0.41 millis 1.95 millis
|
||||
|
@ -217,7 +217,7 @@ static maybe_t<int> builtin_generic(parser_t &parser, io_streams_t &streams, wch
|
||||
|
||||
// Hackish - if we have no arguments other than the command, we are a "naked invocation" and we
|
||||
// just print help.
|
||||
if (argc == 1) {
|
||||
if (argc == 1 || wcscmp(cmd, L"time") == 0) {
|
||||
builtin_print_help(parser, streams, cmd);
|
||||
return STATUS_INVALID_ARGS;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user