diff --git a/cmd/root.go b/cmd/root.go index d4ea034c..32880ca2 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -21,7 +21,10 @@ See https://mikefarah.gitbook.io/yq/ for detailed documentation and examples.`, cat myfile.yml | yq '.stuff' # update myfile.yml in place -yq -i '.stuff = "foo"' myfile.yml # update myfile.yml inplace +yq -i '.stuff = "foo"' myfile.yml + +# print contents of sample.json as idiomatic YAML +yq -P '.' sample.json `, RunE: func(cmd *cobra.Command, args []string) error {