mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-30 03:01:15 -03:00
string: Fix swapped arguments in error message
Really this could do with a bespoke error, but this'll do for now.
This commit is contained in:
@@ -68,7 +68,7 @@ fn take_args(
|
||||
};
|
||||
*optind += 1;
|
||||
let Some(replacement) = args.get(*optind).copied() else {
|
||||
err_fmt!(Error::UNEXP_ARG_COUNT, 1, 2)
|
||||
err_fmt!(Error::UNEXP_ARG_COUNT, 2, 1)
|
||||
.subcmd(cmd, subcmd)
|
||||
.finish(streams);
|
||||
return Err(STATUS_INVALID_ARGS);
|
||||
|
||||
@@ -1311,7 +1311,7 @@ string replace --max-matches 99999999999999999999
|
||||
string replace
|
||||
# CHECKERR: string replace: missing argument
|
||||
string replace one
|
||||
# CHECKERR: string replace: expected 1 arguments; got 2
|
||||
# CHECKERR: string replace: expected 2 arguments; got 1
|
||||
|
||||
string replace -r o '${bad_name}' foobar
|
||||
# CHECKERR: string replace: Regular expression substitute error: unknown substring
|
||||
|
||||
Reference in New Issue
Block a user