We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents bee8c2f + 8744b3d commit ed0bb9aCopy full SHA for ed0bb9a
main.go
@@ -79,7 +79,9 @@ var RootCmd = &cobra.Command{
79
}
80
// We detect whether we have anything on stdin to process if we have no arguments
81
// or if the argument is a -
82
- if (len(args) < 1 || args[0] == "-") && !windowsStdinIssue && ((stat.Mode() & os.ModeCharDevice) == 0) {
+ notty := (stat.Mode() & os.ModeCharDevice) == 0
83
+ noFileOrDirArgs := (len(args) < 1 || args[0] == "-") && len(directories) < 1
84
+ if noFileOrDirArgs && !windowsStdinIssue && notty {
85
var buffer bytes.Buffer
86
scanner := bufio.NewScanner(os.Stdin)
87
for scanner.Scan() {
0 commit comments