No longer auto-read from STDIN if there are files given (#1115)

This commit is contained in:
Mike Farah
2022-02-20 13:15:21 +11:00
parent 75fffc17e1
commit 304fc462a4
2 changed files with 14 additions and 5 deletions
+5 -1
View File
@@ -117,7 +117,11 @@ func maybeFile(str string) bool {
}
func processStdInArgs(pipingStdin bool, args []string) []string {
if !pipingStdin {
// if we've been given a file, don't automatically
// read from stdin.
// this happens if there is more than one argument
// or only one argument and its a file
if !pipingStdin || len(args) > 1 || (len(args) > 0 && maybeFile(args[0])) {
return args
}