diff --git a/fish-rust/src/builtins/function.rs b/fish-rust/src/builtins/function.rs index 0f452c134..ec0b20338 100644 --- a/fish-rust/src/builtins/function.rs +++ b/fish-rust/src/builtins/function.rs @@ -156,7 +156,7 @@ fn parse_cmd_opts( if pid.is_err() || pid.unwrap() < 0 { streams .err - .append(wgettext_fmt!("%ls: %ls: invalid process id", cmd)); + .append(wgettext_fmt!("%ls: %ls: invalid process id", cmd, woptarg)); return STATUS_INVALID_ARGS; } let pid = pid.unwrap(); diff --git a/tests/checks/function.fish b/tests/checks/function.fish index c4be11e71..e665e89ec 100644 --- a/tests/checks/function.fish +++ b/tests/checks/function.fish @@ -162,4 +162,9 @@ end rm -r $tmpdir +function foo -p bar; end +# CHECKERR: {{.*}}function.fish (line {{\d+}}): function: bar: invalid process id +# CHECKERR: function foo -p bar; end +# CHECKERR: ^~~~~~~~~~~~~~~~~~~^ + exit 0