From d18aa3e9e0491e68c2981af18c0cea14727c1521 Mon Sep 17 00:00:00 2001 From: Mike Farah Date: Fri, 20 Aug 2021 15:46:33 +1000 Subject: [PATCH] Added shorthand output formats --- acceptance_tests/output-format.sh | 46 ++++++++++++++++++++++++++++--- cmd/root.go | 2 +- pkg/yqlib/printer.go | 6 ++-- 3 files changed, 46 insertions(+), 8 deletions(-) diff --git a/acceptance_tests/output-format.sh b/acceptance_tests/output-format.sh index 4d9c3f1a..a36290b5 100755 --- a/acceptance_tests/output-format.sh +++ b/acceptance_tests/output-format.sh @@ -37,10 +37,32 @@ EOL } EOM - X=$(./yq e -o=json test.yml) + X=$(./yq e --output-format=json test.yml) assertEquals "$expected" "$X" - X=$(./yq ea -o=json test.yml) + X=$(./yq ea --output-format=json test.yml) + assertEquals "$expected" "$X" +} + +testOutputJsonShort() { + cat >test.yml <test.yml <