diff --git a/fish-rust/src/expand.rs b/fish-rust/src/expand.rs index db27ad23d..ae6373d78 100644 --- a/fish-rust/src/expand.rs +++ b/fish-rust/src/expand.rs @@ -1347,7 +1347,7 @@ impl<'a, 'b, 'c> Expander<'a, 'b, 'c> { self.errors, start, end, - "command substitutions not allowed here" + "command substitutions not allowed in command position. Try var=(your-cmd) $var ..." ); } return ExpandResult::make_error(STATUS_EXPAND_ERROR.unwrap()); diff --git a/tests/checks/expansion.fish b/tests/checks/expansion.fish index 2f72e24f6..d1bf5180d 100644 --- a/tests/checks/expansion.fish +++ b/tests/checks/expansion.fish @@ -325,7 +325,7 @@ $fish -c 'echo {}}' #CHECKERR: echo {}} #CHECKERR: ^ printf '<%s>\n' ($fish -c 'command (asd)' 2>&1) -#CHECK: +#CHECK: #CHECK: #CHECK: < ^~~~^> true diff --git a/tests/checks/syntax-error-location.fish b/tests/checks/syntax-error-location.fish index 7bc53e4cd..9821d752d 100644 --- a/tests/checks/syntax-error-location.fish +++ b/tests/checks/syntax-error-location.fish @@ -25,7 +25,7 @@ FOO=BAR (true one) # more things ' | $fish 2>| string replace -r '(.*)' '<$1>' -# CHECK: +# CHECK: # CHECK: # CHECK: < ^~~~~~~~~^>