Improve the "input and output are the same file" error text (#12619)

# Description
Continuing from #12601, this PR improves the error message help text and
adds an example to `collect`.
This commit is contained in:
Ian Manske
2024-04-22 14:00:38 +00:00
committed by GitHub
parent 20bf3c587f
commit 797a90520c
2 changed files with 19 additions and 12 deletions

View File

@ -260,7 +260,7 @@ fn saving_to_source_file_error(dest: &Spanned<PathBuf>) -> ShellError {
dest.item.display()
),
span: Some(dest.span),
help: Some("you should change the output path".into()),
help: Some("You should use `collect` to run your save command (see `help collect`). Or, you can put the file data in a variable and then pass the variable to `save`.".into()),
inner: vec![],
}
}