Emit an error if time is used past the first command in a pipeline

Fixes #8841
This commit is contained in:
ridiculousfish
2022-03-31 16:14:59 -07:00
parent 247d4b2c8f
commit a960a3cde6
3 changed files with 15 additions and 0 deletions

View File

@@ -11,6 +11,12 @@ $status
# CHECK: <echo foo | exec grep # this exec is not allowed!>
# CHECK: < ^>
echo 'true | time false' | $fish 2>| string replace -r '(.*)' '<$1>'
# CHECK: <fish: The 'time' command may only be at the beginning of a pipeline>
# CHECK: <true | time false>
# CHECK: < ^>
echo '
(true one)