mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 13:23:09 +00:00
Builtin source to print error if missing both file argument and piped stdin
Closes #10774
This commit is contained in:
parent
00875d0f83
commit
2dafe81f97
1 changed files with 4 additions and 0 deletions
|
@ -45,6 +45,10 @@ pub fn source(parser: &Parser, streams: &mut IoStreams, args: &mut [&wstr]) -> O
|
||||||
// Either a bare `source` which means to implicitly read from stdin or an explicit `-`.
|
// Either a bare `source` which means to implicitly read from stdin or an explicit `-`.
|
||||||
if argc == optind && isatty(streams.stdin_fd) {
|
if argc == optind && isatty(streams.stdin_fd) {
|
||||||
// Don't implicitly read from the terminal.
|
// Don't implicitly read from the terminal.
|
||||||
|
streams.err.append(wgettext_fmt!(
|
||||||
|
"%ls: missing filename argument or input redirection\n",
|
||||||
|
cmd
|
||||||
|
));
|
||||||
return STATUS_CMD_ERROR;
|
return STATUS_CMD_ERROR;
|
||||||
}
|
}
|
||||||
func_filename = FilenameRef::new(L!("-").to_owned());
|
func_filename = FilenameRef::new(L!("-").to_owned());
|
||||||
|
|
Loading…
Reference in a new issue