diff --git a/README.md b/README.md index 70cd5437..589f83f8 100644 --- a/README.md +++ b/README.md @@ -176,6 +176,7 @@ Supported by @rmescandon (https://launchpad.net/~rmescandon/+archive/ubuntu/yq) - Written in portable go, so you can download a lovely dependency free binary - Uses similar syntax as `jq` but works with YAML and JSON files - Fully supports multi document yaml files +- Supports yaml [front matter](https://mikefarah.gitbook.io/yq/usage/front-matter) blocks (e.g. jekyll/assemble) - Colorized yaml output - [Deeply traverse yaml](https://mikefarah.gitbook.io/yq/operators/traverse-read) - [Sort yaml by keys](https://mikefarah.gitbook.io/yq/operators/sort-keys) @@ -199,24 +200,26 @@ Usage: yq [command] Available Commands: - eval Apply expression to each document in each yaml file given in sequence + eval Apply the expression to each document in each yaml file in sequence eval-all Loads _all_ yaml documents of _all_ yaml files and runs expression once help Help about any command shell-completion Generate completion script Flags: - -C, --colors force print with colors - -e, --exit-status set exit status if there are no matches or null or false is returned - -h, --help help for yq - -I, --indent int sets indent level for output (default 2) - -i, --inplace update the yaml file inplace of first yaml file given. - -M, --no-colors force print with no colors - -N, --no-doc Don't print document separators (---) - -n, --null-input Don't read input, simply evaluate the expression given. Useful for creating yaml docs from scratch. - -P, --prettyPrint pretty print, shorthand for '... style = ""' - -j, --tojson output as json. Set indent to 0 to print json in one line. - -v, --verbose verbose mode - -V, --version Print version information and quit + -C, --colors force print with colors + -e, --exit-status set exit status if there are no matches or null or false is returned + -f, --front-matter string (extract|process) first input as yaml front-matter. Extract will pull out the yaml content, process will run the expression against the yaml content, leaving the remaining data intact + -h, --help help for yq + -I, --indent int sets indent level for output (default 2) + -i, --inplace update the yaml file inplace of first yaml file given. + -M, --no-colors force print with no colors + -N, --no-doc Don't print document separators (---) + -n, --null-input Don't read input, simply evaluate the expression given. Useful for creating yaml docs from scratch. + -P, --prettyPrint pretty print, shorthand for '... style = ""' + -j, --tojson output as json. Set indent to 0 to print json in one line. + --unwrapScalar unwrap scalar, print the value with no quotes, colors or comments (default true) + -v, --verbose verbose mode + -V, --version Print version information and quit Use "yq [command] --help" for more information about a command. ``` diff --git a/cmd/root.go b/cmd/root.go index b860547c..6c18b08a 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -54,7 +54,7 @@ See https://mikefarah.gitbook.io/yq/ for detailed documentation and examples.`, rootCmd.PersistentFlags().BoolVarP(&forceColor, "colors", "C", false, "force print with colors") rootCmd.PersistentFlags().BoolVarP(&forceNoColor, "no-colors", "M", false, "force print with no colors") - rootCmd.PersistentFlags().StringVarP(&frontMatter, "front-matter", "f", "", "(extract|process) first input as yaml front-matter. Extract will pull out the yaml content, process will run the expression against the yaml content, leaving the remaining data in-tact") + rootCmd.PersistentFlags().StringVarP(&frontMatter, "front-matter", "f", "", "(extract|process) first input as yaml front-matter. Extract will pull out the yaml content, process will run the expression against the yaml content, leaving the remaining data intact") rootCmd.AddCommand( createEvaluateSequenceCommand(), createEvaluateAllCommand(), diff --git a/cmd/version.go b/cmd/version.go index 35a608da..403fdadb 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -11,7 +11,7 @@ var ( GitDescribe string // Version is main version number that is being run at the moment. - Version = "4.10.0" + Version = "4.11.0" // VersionPrerelease is a pre-release marker for the version. If this is "" (empty string) // then it means that it is a final release. Otherwise, this is a pre-release diff --git a/examples/front-matter.yaml b/examples/front-matter.yaml index 7fb3e974..0eee5d3e 100644 --- a/examples/front-matter.yaml +++ b/examples/front-matter.yaml @@ -1,5 +1,5 @@ --- -a: fruit -b: banana +a: apple +b: bannana --- -content: cool +

I like {{a}} and {{b}}

\ No newline at end of file diff --git a/github-action/Dockerfile b/github-action/Dockerfile index 5a7b129b..cadb45e4 100644 --- a/github-action/Dockerfile +++ b/github-action/Dockerfile @@ -1,4 +1,4 @@ -FROM mikefarah/yq:4.10.0 +FROM mikefarah/yq:4.11.0 COPY entrypoint.sh /entrypoint.sh diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 51b807e8..34061716 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,5 +1,5 @@ name: yq -version: '4.10.0' +version: '4.11.0' summary: A lightweight and portable command-line YAML processor description: | The aim of the project is to be the jq or sed of yaml files.