yqis quite different from previous versions (and I apologise for that) - however it will be very familiar if you have used
jqbefore as it now uses a similar syntax. Most commands that you could do in
v3are longer in
v4as a result of having a more expressive syntax language.
v4by default now:
v3yq had seperate commands for reading/writing/deleting and more. In
v4all these have been embedded into a single expression you specify to either the
evalcommand (which runs the expression against each yaml document for each file given in sequence) or the
eval-allcommand, which reads all documents of all files, and runs the given expression once.
v3have been put into the expression language, for instance
stripCommentsallowing you to specify which nodes to strip comments from instead of only being able to apply the flag to the entire document.
jq, merge is done via the multiply operator. You will need to use the eval-all command to load all documents into memory at once, and then use the file operator to select the file nodes to merge.
yqto run through the expression pipeline - for what it's worth, this is what
jqdoes as well. Instead use the
--null-input/-nflag and pipe out the results to the file you want directly (see example below).
v3so expect to see more features soon!