mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-02 23:34:48 +08:00
Smarter behaviour when piping data in with one argument
This commit is contained in:
@@ -120,6 +120,10 @@ func evaluateAll(cmd *cobra.Command, args []string) (cmdError error) {
|
||||
case 1:
|
||||
if nullInput {
|
||||
err = yqlib.NewStreamEvaluator().EvaluateNew(processExpression(args[0]), printer, "")
|
||||
} else if pipingStdIn && args[0] != "-" {
|
||||
// must have given a single expression and piping input from stdin
|
||||
err = allAtOnceEvaluator.EvaluateFiles(processExpression(args[0]), []string{"-"}, printer, leadingContentPreProcessing, decoder)
|
||||
|
||||
} else {
|
||||
err = allAtOnceEvaluator.EvaluateFiles(processExpression(""), []string{args[0]}, printer, leadingContentPreProcessing, decoder)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user