Skip to content

Commit

Permalink
jpp: Make stream behavior unconditional and remove --stream, -s flag
Browse files Browse the repository at this point in the history
Mirrors sentiments expressed here:

jmespath/jp#14 (comment)
jmespath/jp#14 (comment)
  • Loading branch information
zmedico committed Jun 15, 2021
1 parent ba4e883 commit d75cf88
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
7 changes: 0 additions & 7 deletions cmd/jpp/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ func main() {
Name: "unquoted, u",
Usage: "If the final result is a string, it will be printed without quotes.",
},
cli.BoolFlag{
Name: "stream, s",
Usage: "Parse JSON elements until the input stream is exhausted (rather than just the first).",
},
cli.BoolFlag{
Name: "ast",
Usage: "Only print the AST of the parsed expression. Do not rely on this output, only useful for debugging purposes.",
Expand Down Expand Up @@ -135,9 +131,6 @@ func runMain(c *cli.Context) int {
os.Stdout.Write(toJSON)
}
os.Stdout.WriteString("\n")
if !c.Bool("stream") {
break
}
}
return 0
}
2 changes: 1 addition & 1 deletion test/cases/search.bats
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
}

@test "Processes subsequent data in stream mode" {
output=$(echo '{"foo": "bar"}{"foo": "x"}' | ./jpp -s foo)
output=$(echo '{"foo": "bar"}{"foo": "x"}' | ./jpp foo)
echo "$output"
[ "$output" == $'\"bar\"\n\"x\"' ]
}
Expand Down

0 comments on commit d75cf88

Please sign in to comment.