mirror of
https://github.com/taigrr/yq
synced 2025-01-18 04:53:17 -08:00
Compare commits
41 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
90fe9c6512 | ||
|
|
a9ade5a832 | ||
|
|
8d6e3a6a75 | ||
|
|
7a6689eb40 | ||
|
|
e6660e2460 | ||
|
|
28169b04f7 | ||
|
|
742cf748ac | ||
|
|
54c06cdb4c | ||
|
|
ef5f745da3 | ||
|
|
25025f2771 | ||
|
|
ebb8b34b31 | ||
|
|
9a5e4ee828 | ||
|
|
0a2dd29940 | ||
|
|
50dfce86c9 | ||
|
|
e55006e935 | ||
|
|
d8fed62f03 | ||
|
|
52a39bf31e | ||
|
|
d84254c30f | ||
|
|
18bb4eee96 | ||
|
|
86b9fe3ef9 | ||
|
|
2c15048ddb | ||
|
|
ce2ee42f71 | ||
|
|
c2c49dcb17 | ||
|
|
60de18391c | ||
|
|
c86f8b426b | ||
|
|
b3532e0a61 | ||
|
|
b3b60665e4 | ||
|
|
df08b055cf | ||
|
|
e822313e82 | ||
|
|
a9f25c9d76 | ||
|
|
0a8c268dcc | ||
|
|
a0e70279a8 | ||
|
|
25c9c22d8d | ||
|
|
d46d555b07 | ||
|
|
fb87f638f2 | ||
|
|
facc81d1f4 | ||
|
|
c1f9065c68 | ||
|
|
be84cc3082 | ||
|
|
a2571da1a1 | ||
|
|
6d6e476ac8 | ||
|
|
ae0c042ae6 |
@@ -2,9 +2,16 @@ FROM golang:1.9 as builder
|
|||||||
|
|
||||||
WORKDIR /go/src/mikefarah/yq
|
WORKDIR /go/src/mikefarah/yq
|
||||||
|
|
||||||
|
# cache devtools
|
||||||
|
COPY ./scripts/devtools.sh /go/src/mikefarah/yq/scripts/devtools.sh
|
||||||
|
RUN ./scripts/devtools.sh
|
||||||
|
|
||||||
|
# cache vendor
|
||||||
|
COPY ./vendor/vendor.json /go/src/mikefarah/yq/vendor/vendor.json
|
||||||
|
RUN govendor sync
|
||||||
|
|
||||||
COPY . /go/src/mikefarah/yq
|
COPY . /go/src/mikefarah/yq
|
||||||
|
|
||||||
RUN scripts/devtools.sh
|
|
||||||
RUN CGO_ENABLED=0 make local build
|
RUN CGO_ENABLED=0 make local build
|
||||||
|
|
||||||
# Choose alpine as a base image to make this useful for CI, as many
|
# Choose alpine as a base image to make this useful for CI, as many
|
||||||
|
|||||||
36
README.md
36
README.md
@@ -1,4 +1,8 @@
|
|||||||
# yq [](https://travis-ci.org/mikefarah/yq)
|
# yq
|
||||||
|
|
||||||
|
[](https://travis-ci.org/mikefarah/yq)  
|
||||||
|
|
||||||
|
|
||||||
a lightweight and portable command-line YAML processor
|
a lightweight and portable command-line YAML processor
|
||||||
|
|
||||||
The aim of the project is to be the [jq](https://github.com/stedolan/jq) or sed of yaml files.
|
The aim of the project is to be the [jq](https://github.com/stedolan/jq) or sed of yaml files.
|
||||||
@@ -20,7 +24,7 @@ sudo apt install yq -y
|
|||||||
```
|
```
|
||||||
or, [Download latest binary](https://github.com/mikefarah/yq/releases/latest) or alternatively:
|
or, [Download latest binary](https://github.com/mikefarah/yq/releases/latest) or alternatively:
|
||||||
```
|
```
|
||||||
go get github.com/mikefarah/yq
|
go get gopkg.in/mikefarah/yq.v2
|
||||||
```
|
```
|
||||||
|
|
||||||
## Run with Docker
|
## Run with Docker
|
||||||
@@ -49,7 +53,9 @@ docker run -it -v ${PWD}:/workdir mikefarah/yq sh
|
|||||||
- Convert from yaml to json
|
- Convert from yaml to json
|
||||||
- Pipe data in by using '-'
|
- Pipe data in by using '-'
|
||||||
- Merge multiple yaml files where each additional file sets values for missing or null value keys.
|
- Merge multiple yaml files where each additional file sets values for missing or null value keys.
|
||||||
- Merge multiple yaml files with overwrite to support overriding previous values.
|
- Merge multiple yaml files and override previous values.
|
||||||
|
- Merge multiple yaml files and append array values.
|
||||||
|
- Supports multiple documents in a single yaml file
|
||||||
|
|
||||||
## [Usage](http://mikefarah.github.io/yq/)
|
## [Usage](http://mikefarah.github.io/yq/)
|
||||||
|
|
||||||
@@ -61,16 +67,15 @@ Usage:
|
|||||||
yq [command]
|
yq [command]
|
||||||
|
|
||||||
Available Commands:
|
Available Commands:
|
||||||
delete yq d [--inplace/-i] sample.yaml a.b.c
|
delete yq d [--inplace/-i] [--doc/-d index] sample.yaml a.b.c
|
||||||
help Help about any command
|
help Help about any command
|
||||||
merge yq m [--inplace/-i] [--overwrite/-x] sample.yaml sample2.yaml
|
merge yq m [--inplace/-i] [--doc/-d index] [--overwrite/-x] [--append/-a] sample.yaml sample2.yaml
|
||||||
new yq n [--script/-s script_file] a.b.c newValueForC
|
new yq n [--script/-s script_file] a.b.c newValue
|
||||||
read yq r sample.yaml a.b.c
|
read yq r [--doc/-d index] sample.yaml a.b.c
|
||||||
write yq w [--inplace/-i] [--script/-s script_file] sample.yaml a.b.c newValueForC
|
write yq w [--inplace/-i] [--script/-s script_file] [--doc/-d index] sample.yaml a.b.c newValue
|
||||||
|
|
||||||
Flags:
|
Flags:
|
||||||
-h, --help help for yq
|
-h, --help help for yq
|
||||||
-j, --tojson output as json
|
|
||||||
-t, --trim trim yaml output (default true)
|
-t, --trim trim yaml output (default true)
|
||||||
-v, --verbose verbose mode
|
-v, --verbose verbose mode
|
||||||
-V, --version Print version information and quit
|
-V, --version Print version information and quit
|
||||||
@@ -79,12 +84,13 @@ Use "yq [command] --help" for more information about a command.
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Contribute
|
## Contribute
|
||||||
1. `make [local] vendor`
|
1. `scripts/devtools.sh`
|
||||||
2. add unit tests
|
2. `make [local] vendor`
|
||||||
3. apply changes
|
3. add unit tests
|
||||||
4. `make [local] build`
|
4. apply changes (use govendor with a preference to [gopkg](https://gopkg.in/) for package dependencies)
|
||||||
5. If required, update the user documentation
|
5. `make [local] build`
|
||||||
|
6. If required, update the user documentation
|
||||||
- Update README.md and/or documentation under the mkdocs folder
|
- Update README.md and/or documentation under the mkdocs folder
|
||||||
- `make [local] build-docs`
|
- `make [local] build-docs`
|
||||||
- browse to docs/index.html and check your changes
|
- browse to docs/index.html and check your changes
|
||||||
6. profit
|
7. profit
|
||||||
|
|||||||
293
commands_test.go
293
commands_test.go
@@ -2,10 +2,11 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"gopkg.in/spf13/cobra.v0"
|
||||||
)
|
)
|
||||||
|
|
||||||
func getRootCommand() *cobra.Command {
|
func getRootCommand() *cobra.Command {
|
||||||
@@ -73,30 +74,6 @@ func TestRootCmd_TrimShort(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestRootCmd_ToJsonLong(t *testing.T) {
|
|
||||||
cmd := getRootCommand()
|
|
||||||
result := runCmd(cmd, "--tojson")
|
|
||||||
if result.Error != nil {
|
|
||||||
t.Error(result.Error)
|
|
||||||
}
|
|
||||||
|
|
||||||
if !outputToJSON {
|
|
||||||
t.Error("Expected outputToJSON to be true")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestRootCmd_ToJsonShort(t *testing.T) {
|
|
||||||
cmd := getRootCommand()
|
|
||||||
result := runCmd(cmd, "-j")
|
|
||||||
if result.Error != nil {
|
|
||||||
t.Error(result.Error)
|
|
||||||
}
|
|
||||||
|
|
||||||
if !outputToJSON {
|
|
||||||
t.Error("Expected outputToJSON to be true")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestRootCmd_VersionShort(t *testing.T) {
|
func TestRootCmd_VersionShort(t *testing.T) {
|
||||||
cmd := getRootCommand()
|
cmd := getRootCommand()
|
||||||
result := runCmd(cmd, "-V")
|
result := runCmd(cmd, "-V")
|
||||||
@@ -128,6 +105,39 @@ func TestReadCmd(t *testing.T) {
|
|||||||
assertResult(t, "2\n", result.Output)
|
assertResult(t, "2\n", result.Output)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestReadInvalidDocumentIndexCmd(t *testing.T) {
|
||||||
|
cmd := getRootCommand()
|
||||||
|
result := runCmd(cmd, "read -df examples/sample.yaml b.c")
|
||||||
|
if result.Error == nil {
|
||||||
|
t.Error("Expected command to fail due to invalid path")
|
||||||
|
}
|
||||||
|
expectedOutput := `Document index f is not a integer or *: strconv.ParseInt: parsing "f": invalid syntax`
|
||||||
|
assertResult(t, expectedOutput, result.Error.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestReadBadDocumentIndexCmd(t *testing.T) {
|
||||||
|
cmd := getRootCommand()
|
||||||
|
result := runCmd(cmd, "read -d1 examples/sample.yaml b.c")
|
||||||
|
if result.Error == nil {
|
||||||
|
t.Error("Expected command to fail due to invalid path")
|
||||||
|
}
|
||||||
|
expectedOutput := `Asked to process document index 1 but there are only 1 document(s)`
|
||||||
|
assertResult(t, expectedOutput, result.Error.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestReadOrderCmd(t *testing.T) {
|
||||||
|
cmd := getRootCommand()
|
||||||
|
result := runCmd(cmd, "read examples/order.yaml")
|
||||||
|
if result.Error != nil {
|
||||||
|
t.Error(result.Error)
|
||||||
|
}
|
||||||
|
assertResult(t,
|
||||||
|
`version: 3
|
||||||
|
application: MyApp
|
||||||
|
`,
|
||||||
|
result.Output)
|
||||||
|
}
|
||||||
|
|
||||||
func TestReadMultiCmd(t *testing.T) {
|
func TestReadMultiCmd(t *testing.T) {
|
||||||
cmd := getRootCommand()
|
cmd := getRootCommand()
|
||||||
result := runCmd(cmd, "read -d 1 examples/multiple_docs.yaml another.document")
|
result := runCmd(cmd, "read -d 1 examples/multiple_docs.yaml another.document")
|
||||||
@@ -137,6 +147,19 @@ func TestReadMultiCmd(t *testing.T) {
|
|||||||
assertResult(t, "here\n", result.Output)
|
assertResult(t, "here\n", result.Output)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestReadMultiAllCmd(t *testing.T) {
|
||||||
|
cmd := getRootCommand()
|
||||||
|
result := runCmd(cmd, "read -d* examples/multiple_docs.yaml commonKey")
|
||||||
|
if result.Error != nil {
|
||||||
|
t.Error(result.Error)
|
||||||
|
}
|
||||||
|
assertResult(t,
|
||||||
|
`- first document
|
||||||
|
- second document
|
||||||
|
- third document
|
||||||
|
`, result.Output)
|
||||||
|
}
|
||||||
|
|
||||||
func TestReadCmd_ArrayYaml(t *testing.T) {
|
func TestReadCmd_ArrayYaml(t *testing.T) {
|
||||||
cmd := getRootCommand()
|
cmd := getRootCommand()
|
||||||
result := runCmd(cmd, "read examples/array.yaml [0].gather_facts")
|
result := runCmd(cmd, "read examples/array.yaml [0].gather_facts")
|
||||||
@@ -216,7 +239,7 @@ func TestReadCmd_ArrayYaml_ErrorBadPath(t *testing.T) {
|
|||||||
if result.Error == nil {
|
if result.Error == nil {
|
||||||
t.Error("Expected command to fail due to invalid path")
|
t.Error("Expected command to fail due to invalid path")
|
||||||
}
|
}
|
||||||
expectedOutput := `Error accessing array: strconv.ParseInt: parsing "x": invalid syntax`
|
expectedOutput := `Error reading path in document index 0: Error accessing array: strconv.ParseInt: parsing "x": invalid syntax`
|
||||||
assertResult(t, expectedOutput, result.Error.Error())
|
assertResult(t, expectedOutput, result.Error.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -226,7 +249,7 @@ func TestReadCmd_ArrayYaml_Splat_ErrorBadPath(t *testing.T) {
|
|||||||
if result.Error == nil {
|
if result.Error == nil {
|
||||||
t.Error("Expected command to fail due to invalid path")
|
t.Error("Expected command to fail due to invalid path")
|
||||||
}
|
}
|
||||||
expectedOutput := `Error accessing array: strconv.ParseInt: parsing "x": invalid syntax`
|
expectedOutput := `Error reading path in document index 0: Error accessing array: strconv.ParseInt: parsing "x": invalid syntax`
|
||||||
assertResult(t, expectedOutput, result.Error.Error())
|
assertResult(t, expectedOutput, result.Error.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -278,7 +301,7 @@ func TestReadCmd_ErrorBadPath(t *testing.T) {
|
|||||||
if result.Error == nil {
|
if result.Error == nil {
|
||||||
t.Fatal("Expected command to fail due to invalid path")
|
t.Fatal("Expected command to fail due to invalid path")
|
||||||
}
|
}
|
||||||
expectedOutput := `Error accessing array: strconv.ParseInt: parsing "x": invalid syntax`
|
expectedOutput := `Error reading path in document index 0: Error accessing array: strconv.ParseInt: parsing "x": invalid syntax`
|
||||||
assertResult(t, expectedOutput, result.Error.Error())
|
assertResult(t, expectedOutput, result.Error.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -302,7 +325,16 @@ func TestReadCmd_NoTrim(t *testing.T) {
|
|||||||
|
|
||||||
func TestReadCmd_ToJson(t *testing.T) {
|
func TestReadCmd_ToJson(t *testing.T) {
|
||||||
cmd := getRootCommand()
|
cmd := getRootCommand()
|
||||||
result := runCmd(cmd, "-j read examples/sample.yaml b.c")
|
result := runCmd(cmd, "read -j examples/sample.yaml b.c")
|
||||||
|
if result.Error != nil {
|
||||||
|
t.Error(result.Error)
|
||||||
|
}
|
||||||
|
assertResult(t, "2\n", result.Output)
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestReadCmd_ToJsonLong(t *testing.T) {
|
||||||
|
cmd := getRootCommand()
|
||||||
|
result := runCmd(cmd, "read --tojson examples/sample.yaml b.c")
|
||||||
if result.Error != nil {
|
if result.Error != nil {
|
||||||
t.Error(result.Error)
|
t.Error(result.Error)
|
||||||
}
|
}
|
||||||
@@ -343,17 +375,6 @@ func TestNewCmd_Verbose(t *testing.T) {
|
|||||||
assertResult(t, expectedOutput, result.Output)
|
assertResult(t, expectedOutput, result.Output)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestNewCmd_ToJson(t *testing.T) {
|
|
||||||
cmd := getRootCommand()
|
|
||||||
result := runCmd(cmd, "-j new b.c 3")
|
|
||||||
if result.Error != nil {
|
|
||||||
t.Error(result.Error)
|
|
||||||
}
|
|
||||||
expectedOutput := `{"b":{"c":3}}
|
|
||||||
`
|
|
||||||
assertResult(t, expectedOutput, result.Output)
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestWriteCmd(t *testing.T) {
|
func TestWriteCmd(t *testing.T) {
|
||||||
content := `b:
|
content := `b:
|
||||||
c: 3
|
c: 3
|
||||||
@@ -393,6 +414,58 @@ apples: ok
|
|||||||
`
|
`
|
||||||
assertResult(t, expectedOutput, result.Output)
|
assertResult(t, expectedOutput, result.Output)
|
||||||
}
|
}
|
||||||
|
func TestWriteInvalidDocumentIndexCmd(t *testing.T) {
|
||||||
|
content := `b:
|
||||||
|
c: 3
|
||||||
|
`
|
||||||
|
filename := writeTempYamlFile(content)
|
||||||
|
defer removeTempYamlFile(filename)
|
||||||
|
|
||||||
|
cmd := getRootCommand()
|
||||||
|
result := runCmd(cmd, fmt.Sprintf("write %s -df apples ok", filename))
|
||||||
|
if result.Error == nil {
|
||||||
|
t.Error("Expected command to fail due to invalid path")
|
||||||
|
}
|
||||||
|
expectedOutput := `Document index f is not a integer or *: strconv.ParseInt: parsing "f": invalid syntax`
|
||||||
|
assertResult(t, expectedOutput, result.Error.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestWriteBadDocumentIndexCmd(t *testing.T) {
|
||||||
|
content := `b:
|
||||||
|
c: 3
|
||||||
|
`
|
||||||
|
filename := writeTempYamlFile(content)
|
||||||
|
defer removeTempYamlFile(filename)
|
||||||
|
|
||||||
|
cmd := getRootCommand()
|
||||||
|
result := runCmd(cmd, fmt.Sprintf("write %s -d 1 apples ok", filename))
|
||||||
|
if result.Error == nil {
|
||||||
|
t.Error("Expected command to fail due to invalid path")
|
||||||
|
}
|
||||||
|
expectedOutput := `Asked to process document index 1 but there are only 1 document(s)`
|
||||||
|
assertResult(t, expectedOutput, result.Error.Error())
|
||||||
|
}
|
||||||
|
func TestWriteMultiAllCmd(t *testing.T) {
|
||||||
|
content := `b:
|
||||||
|
c: 3
|
||||||
|
---
|
||||||
|
apples: great
|
||||||
|
`
|
||||||
|
filename := writeTempYamlFile(content)
|
||||||
|
defer removeTempYamlFile(filename)
|
||||||
|
|
||||||
|
cmd := getRootCommand()
|
||||||
|
result := runCmd(cmd, fmt.Sprintf("write %s -d * apples ok", filename))
|
||||||
|
if result.Error != nil {
|
||||||
|
t.Error(result.Error)
|
||||||
|
}
|
||||||
|
expectedOutput := `b:
|
||||||
|
c: 3
|
||||||
|
apples: ok
|
||||||
|
---
|
||||||
|
apples: ok`
|
||||||
|
assertResult(t, expectedOutput, strings.Trim(result.Output, "\n "))
|
||||||
|
}
|
||||||
|
|
||||||
func TestWriteCmd_EmptyArray(t *testing.T) {
|
func TestWriteCmd_EmptyArray(t *testing.T) {
|
||||||
content := `b: 3`
|
content := `b: 3`
|
||||||
@@ -528,7 +601,7 @@ b:
|
|||||||
func TestDeleteYamlArray(t *testing.T) {
|
func TestDeleteYamlArray(t *testing.T) {
|
||||||
content := `- 1
|
content := `- 1
|
||||||
- 2
|
- 2
|
||||||
- 3
|
- 3
|
||||||
`
|
`
|
||||||
filename := writeTempYamlFile(content)
|
filename := writeTempYamlFile(content)
|
||||||
defer removeTempYamlFile(filename)
|
defer removeTempYamlFile(filename)
|
||||||
@@ -569,6 +642,29 @@ func TestDeleteYamlMulti(t *testing.T) {
|
|||||||
assertResult(t, expectedOutput, result.Output)
|
assertResult(t, expectedOutput, result.Output)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestDeleteYamlMultiAllCmd(t *testing.T) {
|
||||||
|
content := `b:
|
||||||
|
c: 3
|
||||||
|
apples: great
|
||||||
|
---
|
||||||
|
apples: great
|
||||||
|
something: else
|
||||||
|
`
|
||||||
|
filename := writeTempYamlFile(content)
|
||||||
|
defer removeTempYamlFile(filename)
|
||||||
|
|
||||||
|
cmd := getRootCommand()
|
||||||
|
result := runCmd(cmd, fmt.Sprintf("delete %s -d * apples", filename))
|
||||||
|
if result.Error != nil {
|
||||||
|
t.Error(result.Error)
|
||||||
|
}
|
||||||
|
expectedOutput := `b:
|
||||||
|
c: 3
|
||||||
|
---
|
||||||
|
something: else`
|
||||||
|
assertResult(t, expectedOutput, strings.Trim(result.Output, "\n "))
|
||||||
|
}
|
||||||
|
|
||||||
func TestMergeCmd(t *testing.T) {
|
func TestMergeCmd(t *testing.T) {
|
||||||
cmd := getRootCommand()
|
cmd := getRootCommand()
|
||||||
result := runCmd(cmd, "merge examples/data1.yaml examples/data2.yaml")
|
result := runCmd(cmd, "merge examples/data1.yaml examples/data2.yaml")
|
||||||
@@ -585,6 +681,54 @@ c:
|
|||||||
assertResult(t, expectedOutput, result.Output)
|
assertResult(t, expectedOutput, result.Output)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestMergeOverwriteCmd(t *testing.T) {
|
||||||
|
cmd := getRootCommand()
|
||||||
|
result := runCmd(cmd, "merge --overwrite examples/data1.yaml examples/data2.yaml")
|
||||||
|
if result.Error != nil {
|
||||||
|
t.Error(result.Error)
|
||||||
|
}
|
||||||
|
expectedOutput := `a: other
|
||||||
|
b:
|
||||||
|
- 3
|
||||||
|
- 4
|
||||||
|
c:
|
||||||
|
test: 1
|
||||||
|
`
|
||||||
|
assertResult(t, expectedOutput, result.Output)
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestMergeAppendCmd(t *testing.T) {
|
||||||
|
cmd := getRootCommand()
|
||||||
|
result := runCmd(cmd, "merge --append examples/data1.yaml examples/data2.yaml")
|
||||||
|
if result.Error != nil {
|
||||||
|
t.Error(result.Error)
|
||||||
|
}
|
||||||
|
expectedOutput := `a: simple
|
||||||
|
b:
|
||||||
|
- 1
|
||||||
|
- 2
|
||||||
|
- 3
|
||||||
|
- 4
|
||||||
|
c:
|
||||||
|
test: 1
|
||||||
|
`
|
||||||
|
assertResult(t, expectedOutput, result.Output)
|
||||||
|
}
|
||||||
|
func TestMergeArraysCmd(t *testing.T) {
|
||||||
|
cmd := getRootCommand()
|
||||||
|
result := runCmd(cmd, "merge --append examples/sample_array.yaml examples/sample_array_2.yaml")
|
||||||
|
if result.Error != nil {
|
||||||
|
t.Error(result.Error)
|
||||||
|
}
|
||||||
|
expectedOutput := `- 1
|
||||||
|
- 2
|
||||||
|
- 3
|
||||||
|
- 4
|
||||||
|
- 5
|
||||||
|
`
|
||||||
|
assertResult(t, expectedOutput, result.Output)
|
||||||
|
}
|
||||||
|
|
||||||
func TestMergeCmd_Multi(t *testing.T) {
|
func TestMergeCmd_Multi(t *testing.T) {
|
||||||
cmd := getRootCommand()
|
cmd := getRootCommand()
|
||||||
result := runCmd(cmd, "merge -d1 examples/multiple_docs_small.yaml examples/data2.yaml")
|
result := runCmd(cmd, "merge -d1 examples/multiple_docs_small.yaml examples/data2.yaml")
|
||||||
@@ -596,6 +740,9 @@ func TestMergeCmd_Multi(t *testing.T) {
|
|||||||
a: other
|
a: other
|
||||||
another:
|
another:
|
||||||
document: here
|
document: here
|
||||||
|
b:
|
||||||
|
- 3
|
||||||
|
- 4
|
||||||
c:
|
c:
|
||||||
test: 1
|
test: 1
|
||||||
---
|
---
|
||||||
@@ -604,6 +751,64 @@ c:
|
|||||||
assertResult(t, expectedOutput, strings.Trim(result.Output, "\n "))
|
assertResult(t, expectedOutput, strings.Trim(result.Output, "\n "))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestMergeYamlMultiAllCmd(t *testing.T) {
|
||||||
|
content := `b:
|
||||||
|
c: 3
|
||||||
|
apples: green
|
||||||
|
---
|
||||||
|
something: else`
|
||||||
|
filename := writeTempYamlFile(content)
|
||||||
|
defer removeTempYamlFile(filename)
|
||||||
|
|
||||||
|
mergeContent := `apples: red
|
||||||
|
something: good`
|
||||||
|
mergeFilename := writeTempYamlFile(mergeContent)
|
||||||
|
defer removeTempYamlFile(mergeFilename)
|
||||||
|
|
||||||
|
cmd := getRootCommand()
|
||||||
|
result := runCmd(cmd, fmt.Sprintf("merge -d* %s %s", filename, mergeFilename))
|
||||||
|
if result.Error != nil {
|
||||||
|
t.Error(result.Error)
|
||||||
|
}
|
||||||
|
expectedOutput := `apples: green
|
||||||
|
b:
|
||||||
|
c: 3
|
||||||
|
something: good
|
||||||
|
---
|
||||||
|
apples: red
|
||||||
|
something: else`
|
||||||
|
assertResult(t, expectedOutput, strings.Trim(result.Output, "\n "))
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestMergeYamlMultiAllOverwriteCmd(t *testing.T) {
|
||||||
|
content := `b:
|
||||||
|
c: 3
|
||||||
|
apples: green
|
||||||
|
---
|
||||||
|
something: else`
|
||||||
|
filename := writeTempYamlFile(content)
|
||||||
|
defer removeTempYamlFile(filename)
|
||||||
|
|
||||||
|
mergeContent := `apples: red
|
||||||
|
something: good`
|
||||||
|
mergeFilename := writeTempYamlFile(mergeContent)
|
||||||
|
defer removeTempYamlFile(mergeFilename)
|
||||||
|
|
||||||
|
cmd := getRootCommand()
|
||||||
|
result := runCmd(cmd, fmt.Sprintf("merge --overwrite -d* %s %s", filename, mergeFilename))
|
||||||
|
if result.Error != nil {
|
||||||
|
t.Error(result.Error)
|
||||||
|
}
|
||||||
|
expectedOutput := `apples: red
|
||||||
|
b:
|
||||||
|
c: 3
|
||||||
|
something: good
|
||||||
|
---
|
||||||
|
apples: red
|
||||||
|
something: good`
|
||||||
|
assertResult(t, expectedOutput, strings.Trim(result.Output, "\n "))
|
||||||
|
}
|
||||||
|
|
||||||
func TestMergeCmd_Error(t *testing.T) {
|
func TestMergeCmd_Error(t *testing.T) {
|
||||||
cmd := getRootCommand()
|
cmd := getRootCommand()
|
||||||
result := runCmd(cmd, "merge examples/data1.yaml")
|
result := runCmd(cmd, "merge examples/data1.yaml")
|
||||||
@@ -642,6 +847,10 @@ c:
|
|||||||
|
|
||||||
func TestMergeCmd_Inplace(t *testing.T) {
|
func TestMergeCmd_Inplace(t *testing.T) {
|
||||||
filename := writeTempYamlFile(readTempYamlFile("examples/data1.yaml"))
|
filename := writeTempYamlFile(readTempYamlFile("examples/data1.yaml"))
|
||||||
|
err := os.Chmod(filename, os.FileMode(int(0666)))
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
defer removeTempYamlFile(filename)
|
defer removeTempYamlFile(filename)
|
||||||
|
|
||||||
cmd := getRootCommand()
|
cmd := getRootCommand()
|
||||||
@@ -649,6 +858,7 @@ func TestMergeCmd_Inplace(t *testing.T) {
|
|||||||
if result.Error != nil {
|
if result.Error != nil {
|
||||||
t.Error(result.Error)
|
t.Error(result.Error)
|
||||||
}
|
}
|
||||||
|
info, _ := os.Stat(filename)
|
||||||
gotOutput := readTempYamlFile(filename)
|
gotOutput := readTempYamlFile(filename)
|
||||||
expectedOutput := `a: simple
|
expectedOutput := `a: simple
|
||||||
b:
|
b:
|
||||||
@@ -657,4 +867,5 @@ b:
|
|||||||
c:
|
c:
|
||||||
test: 1`
|
test: 1`
|
||||||
assertResult(t, expectedOutput, strings.Trim(gotOutput, "\n "))
|
assertResult(t, expectedOutput, strings.Trim(gotOutput, "\n "))
|
||||||
|
assertResult(t, os.FileMode(int(0666)), info.Mode())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"gopkg.in/yaml.v2"
|
yaml "gopkg.in/mikefarah/yaml.v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func entryInSlice(context yaml.MapSlice, key interface{}) *yaml.MapItem {
|
func entryInSlice(context yaml.MapSlice, key interface{}) *yaml.MapItem {
|
||||||
@@ -96,13 +96,11 @@ func writeArray(context interface{}, paths []string, value interface{}) []interf
|
|||||||
if rawIndex == "+" {
|
if rawIndex == "+" {
|
||||||
index = int64(len(array))
|
index = int64(len(array))
|
||||||
} else {
|
} else {
|
||||||
index, _ = strconv.ParseInt(rawIndex, 10, 64)
|
index, _ = strconv.ParseInt(rawIndex, 10, 64) // nolint
|
||||||
|
// writeArray is only called by updatedChildValue which handles parsing the
|
||||||
|
// index, as such this renders this dead code.
|
||||||
}
|
}
|
||||||
// writeArray is only called by updatedChildValue which handles parsing the
|
|
||||||
// index, as such this renders this dead code.
|
|
||||||
// if err != nil {
|
|
||||||
// return array, fmt.Errorf("Error accessing array: %v", err)
|
|
||||||
// }
|
|
||||||
for index >= int64(len(array)) {
|
for index >= int64(len(array)) {
|
||||||
array = append(array, nil)
|
array = append(array, nil)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"sort"
|
"sort"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
yaml "gopkg.in/yaml.v2"
|
yaml "gopkg.in/mikefarah/yaml.v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestReadMap_simple(t *testing.T) {
|
func TestReadMap_simple(t *testing.T) {
|
||||||
|
|||||||
13
debian/changelog
vendored
13
debian/changelog
vendored
@@ -1,3 +1,16 @@
|
|||||||
|
yq (2.1-0) bionic; urgency=medium
|
||||||
|
|
||||||
|
* Ability to read multiple documents in a single file
|
||||||
|
* Ability to append list items instead of overwriting
|
||||||
|
|
||||||
|
-- Roberto Mier Escandón <rmescandon@gmail.com> Tue, 10 Jul 2018 14:02:42 +0200
|
||||||
|
|
||||||
|
yq (2.0-0) bionic; urgency=medium
|
||||||
|
|
||||||
|
* Release 2.0.0
|
||||||
|
|
||||||
|
-- Roberto Mier Escandón <rmescandon@gmail.com> Wed, 20 Jun 2018 10:29:53 +0200
|
||||||
|
|
||||||
yq (1.15-0) bionic; urgency=medium
|
yq (1.15-0) bionic; urgency=medium
|
||||||
|
|
||||||
* Release 1.15
|
* Release 1.15
|
||||||
|
|||||||
@@ -19,6 +19,10 @@
|
|||||||
|
|
||||||
<meta name="lang:search.language" content="en">
|
<meta name="lang:search.language" content="en">
|
||||||
|
|
||||||
|
<meta name="lang:search.pipeline.stopwords" content="True">
|
||||||
|
|
||||||
|
<meta name="lang:search.pipeline.trimmer" content="True">
|
||||||
|
|
||||||
<meta name="lang:search.result.none" content="No matching documents">
|
<meta name="lang:search.result.none" content="No matching documents">
|
||||||
|
|
||||||
<meta name="lang:search.result.one" content="1 matching document">
|
<meta name="lang:search.result.one" content="1 matching document">
|
||||||
@@ -28,7 +32,7 @@
|
|||||||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||||
|
|
||||||
<link rel="shortcut icon" href="/assets/images/favicon.png">
|
<link rel="shortcut icon" href="/assets/images/favicon.png">
|
||||||
<meta name="generator" content="mkdocs-0.17.2, mkdocs-material-2.2.5">
|
<meta name="generator" content="mkdocs-0.17.5, mkdocs-material-2.9.2">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -36,36 +40,56 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="/assets/stylesheets/application.bcabdff3.css">
|
<link rel="stylesheet" href="/assets/stylesheets/application.ba0fd1a6.css">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script src="/assets/javascripts/modernizr.1aa3b519.js"></script>
|
<script src="/assets/javascripts/modernizr.1aa3b519.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
|
||||||
|
|
||||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
|
||||||
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
|
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
|
||||||
|
|
||||||
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
|
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="/assets/fonts/material-icons.css">
|
||||||
|
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body dir="ltr">
|
||||||
|
|
||||||
<svg class="md-svg">
|
<svg class="md-svg">
|
||||||
<defs>
|
<defs>
|
||||||
|
|
||||||
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448" viewBox="0 0 416 448" id="github"><path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19T128 352t-18.125-8.5-10.75-19T96 304t3.125-20.5 10.75-19T128 256t18.125 8.5 10.75 19T160 304zm160 0q0 10-3.125 20.5t-10.75 19T288 352t-18.125-8.5-10.75-19T256 304t3.125-20.5 10.75-19T288 256t18.125 8.5 10.75 19T320 304zm40 0q0-30-17.25-51T296 232q-10.25 0-48.75 5.25Q229.5 240 208 240t-39.25-2.75Q130.75 232 120 232q-29.5 0-46.75 21T56 304q0 22 8 38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0 37.25-1.75t35-7.375 30.5-15 20.25-25.75T360 304zm56-44q0 51.75-15.25 82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5T212 416q-19.5 0-35.5-.75t-36.875-3.125-38.125-7.5-34.25-12.875T37 371.5t-21.5-28.75Q0 312 0 260q0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25 30.875Q171.5 96 212 96q37 0 70 8 26.25-20.5 46.75-30.25T376 64q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34 99.5z"/></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448"
|
||||||
|
viewBox="0 0 416 448" id="__github">
|
||||||
|
<path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19-18.125
|
||||||
|
8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19 18.125-8.5
|
||||||
|
18.125 8.5 10.75 19 3.125 20.5zM320 304q0 10-3.125 20.5t-10.75
|
||||||
|
19-18.125 8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19
|
||||||
|
18.125-8.5 18.125 8.5 10.75 19 3.125 20.5zM360
|
||||||
|
304q0-30-17.25-51t-46.75-21q-10.25 0-48.75 5.25-17.75 2.75-39.25
|
||||||
|
2.75t-39.25-2.75q-38-5.25-48.75-5.25-29.5 0-46.75 21t-17.25 51q0 22 8
|
||||||
|
38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0
|
||||||
|
37.25-1.75t35-7.375 30.5-15 20.25-25.75 8-38.375zM416 260q0 51.75-15.25
|
||||||
|
82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5-41.75
|
||||||
|
1.125q-19.5 0-35.5-0.75t-36.875-3.125-38.125-7.5-34.25-12.875-30.25-20.25-21.5-28.75q-15.5-30.75-15.5-82.75
|
||||||
|
0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25
|
||||||
|
30.875q36.75-8.75 77.25-8.75 37 0 70 8 26.25-20.5
|
||||||
|
46.75-30.25t47.25-9.75q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34
|
||||||
|
99.5z" />
|
||||||
|
</svg>
|
||||||
|
|
||||||
</defs>
|
</defs>
|
||||||
</svg>
|
</svg>
|
||||||
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="drawer">
|
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
|
||||||
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="search">
|
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
|
||||||
<label class="md-overlay" data-md-component="overlay" for="drawer"></label>
|
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
|
||||||
|
|
||||||
|
|
||||||
<header class="md-header" data-md-component="header">
|
<header class="md-header" data-md-component="header">
|
||||||
<nav class="md-header-nav md-grid">
|
<nav class="md-header-nav md-grid">
|
||||||
@@ -78,7 +102,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="md-flex__cell md-flex__cell--shrink">
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
<label class="md-icon md-icon--menu md-header-nav__button" for="drawer"></label>
|
<label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
|
||||||
</div>
|
</div>
|
||||||
<div class="md-flex__cell md-flex__cell--stretch">
|
<div class="md-flex__cell md-flex__cell--stretch">
|
||||||
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
||||||
@@ -97,15 +121,17 @@
|
|||||||
<div class="md-flex__cell md-flex__cell--shrink">
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
|
||||||
|
|
||||||
<label class="md-icon md-icon--search md-header-nav__button" for="search"></label>
|
<label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
|
||||||
|
|
||||||
<div class="md-search" data-md-component="search" role="dialog">
|
<div class="md-search" data-md-component="search" role="dialog">
|
||||||
<label class="md-search__overlay" for="search"></label>
|
<label class="md-search__overlay" for="__search"></label>
|
||||||
<div class="md-search__inner">
|
<div class="md-search__inner" role="search">
|
||||||
<form class="md-search__form" name="search">
|
<form class="md-search__form" name="search">
|
||||||
<input type="text" class="md-search__input" name="query" required placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query">
|
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
|
||||||
<label class="md-icon md-search__icon" for="search"></label>
|
<label class="md-icon md-search__icon" for="__search"></label>
|
||||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset"></button>
|
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||||
|

|
||||||
|
</button>
|
||||||
</form>
|
</form>
|
||||||
<div class="md-search__output">
|
<div class="md-search__output">
|
||||||
<div class="md-search__scrollwrap" data-md-scrollfix>
|
<div class="md-search__scrollwrap" data-md-scrollfix>
|
||||||
@@ -135,7 +161,7 @@
|
|||||||
|
|
||||||
<div class="md-source__icon">
|
<div class="md-source__icon">
|
||||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||||
<use xlink:href="#github" width="24" height="24"></use>
|
<use xlink:href="#__github" width="24" height="24"></use>
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -164,7 +190,7 @@
|
|||||||
<div class="md-sidebar__scrollwrap">
|
<div class="md-sidebar__scrollwrap">
|
||||||
<div class="md-sidebar__inner">
|
<div class="md-sidebar__inner">
|
||||||
<nav class="md-nav md-nav--primary" data-md-level="0">
|
<nav class="md-nav md-nav--primary" data-md-level="0">
|
||||||
<label class="md-nav__title md-nav__title--site" for="drawer">
|
<label class="md-nav__title md-nav__title--site" for="__drawer">
|
||||||
<span class="md-nav__button md-logo">
|
<span class="md-nav__button md-logo">
|
||||||
|
|
||||||
<i class="md-icon"></i>
|
<i class="md-icon"></i>
|
||||||
@@ -184,7 +210,7 @@
|
|||||||
|
|
||||||
<div class="md-source__icon">
|
<div class="md-source__icon">
|
||||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||||
<use xlink:href="#github" width="24" height="24"></use>
|
<use xlink:href="#__github" width="24" height="24"></use>
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -296,6 +322,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
@@ -310,7 +338,7 @@
|
|||||||
<div class="md-footer-copyright">
|
<div class="md-footer-copyright">
|
||||||
|
|
||||||
powered by
|
powered by
|
||||||
<a href="http://www.mkdocs.org">MkDocs</a>
|
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||||
and
|
and
|
||||||
<a href="https://squidfunk.github.io/mkdocs-material/">
|
<a href="https://squidfunk.github.io/mkdocs-material/">
|
||||||
Material for MkDocs</a>
|
Material for MkDocs</a>
|
||||||
@@ -318,8 +346,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<div class="md-footer-social">
|
<div class="md-footer-social">
|
||||||
|
<link rel="stylesheet" href="/assets/fonts/font-awesome.css">
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
|
||||||
|
|
||||||
<a href="https://github.com/mikefarah" class="md-footer-social__link fa fa-github"></a>
|
<a href="https://github.com/mikefarah" class="md-footer-social__link fa fa-github"></a>
|
||||||
|
|
||||||
@@ -334,9 +361,9 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/assets/javascripts/application.6cdc17f0.js"></script>
|
<script src="/assets/javascripts/application.a59e2a89.js"></script>
|
||||||
|
|
||||||
<script>app.initialize({version:"0.17.2",url:{base:""}})</script>
|
<script>app.initialize({version:"0.17.5",url:{base:""}})</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
4
docs/assets/fonts/font-awesome.css
vendored
Normal file
4
docs/assets/fonts/font-awesome.css
vendored
Normal file
File diff suppressed because one or more lines are too long
13
docs/assets/fonts/material-icons.css
Normal file
13
docs/assets/fonts/material-icons.css
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
/*!
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||||
|
* use this file except in compliance with the License. You may obtain a copy
|
||||||
|
* of the License at:
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING, SOFTWARE
|
||||||
|
* DISTRIBUTED UNDER THE LICENSE IS DISTRIBUTED ON AN "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
* SEE THE LICENSE FOR THE SPECIFIC LANGUAGE GOVERNING PERMISSIONS AND
|
||||||
|
* LIMITATIONS UNDER THE LICENSE.
|
||||||
|
*/@font-face{font-family:"Material Icons";font-style:normal;font-weight:400;src:local("Material Icons"),local("MaterialIcons-Regular"),url("specimen/MaterialIcons-Regular.woff2") format("woff2"),url("specimen/MaterialIcons-Regular.woff") format("woff"),url("specimen/MaterialIcons-Regular.ttf") format("truetype")}
|
||||||
BIN
docs/assets/fonts/specimen/FontAwesome.ttf
Normal file
BIN
docs/assets/fonts/specimen/FontAwesome.ttf
Normal file
Binary file not shown.
BIN
docs/assets/fonts/specimen/FontAwesome.woff
Normal file
BIN
docs/assets/fonts/specimen/FontAwesome.woff
Normal file
Binary file not shown.
BIN
docs/assets/fonts/specimen/FontAwesome.woff2
Normal file
BIN
docs/assets/fonts/specimen/FontAwesome.woff2
Normal file
Binary file not shown.
BIN
docs/assets/fonts/specimen/MaterialIcons-Regular.ttf
Normal file
BIN
docs/assets/fonts/specimen/MaterialIcons-Regular.ttf
Normal file
Binary file not shown.
BIN
docs/assets/fonts/specimen/MaterialIcons-Regular.woff
Normal file
BIN
docs/assets/fonts/specimen/MaterialIcons-Regular.woff
Normal file
Binary file not shown.
BIN
docs/assets/fonts/specimen/MaterialIcons-Regular.woff2
Normal file
BIN
docs/assets/fonts/specimen/MaterialIcons-Regular.woff2
Normal file
Binary file not shown.
20
docs/assets/images/icons/bitbucket.1b09e088.svg
Normal file
20
docs/assets/images/icons/bitbucket.1b09e088.svg
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="352" height="448"
|
||||||
|
viewBox="0 0 352 448" id="__bitbucket">
|
||||||
|
<path fill="currentColor" d="M203.75 214.75q2 15.75-12.625 25.25t-27.875
|
||||||
|
1.5q-9.75-4.25-13.375-14.5t-0.125-20.5 13-14.5q9-4.5 18.125-3t16 8.875
|
||||||
|
6.875 16.875zM231.5 209.5q-3.5-26.75-28.25-41t-49.25-3.25q-15.75
|
||||||
|
7-25.125 22.125t-8.625 32.375q1 22.75 19.375 38.75t41.375 14q22.75-2
|
||||||
|
38-21t12.5-42zM291.25
|
||||||
|
74q-5-6.75-14-11.125t-14.5-5.5-17.75-3.125q-72.75-11.75-141.5 0.5-10.75
|
||||||
|
1.75-16.5 3t-13.75 5.5-12.5 10.75q7.5 7 19 11.375t18.375 5.5 21.875
|
||||||
|
2.875q57 7.25 112 0.25 15.75-2 22.375-3t18.125-5.375 18.75-11.625zM305.5
|
||||||
|
332.75q-2 6.5-3.875 19.125t-3.5 21-7.125 17.5-14.5 14.125q-21.5
|
||||||
|
12-47.375 17.875t-50.5 5.5-50.375-4.625q-11.5-2-20.375-4.5t-19.125-6.75-18.25-10.875-13-15.375q-6.25-24-14.25-73l1.5-4
|
||||||
|
4.5-2.25q55.75 37 126.625 37t126.875-37q5.25 1.5 6 5.75t-1.25 11.25-2
|
||||||
|
9.25zM350.75 92.5q-6.5 41.75-27.75 163.75-1.25 7.5-6.75 14t-10.875
|
||||||
|
10-13.625 7.75q-63 31.5-152.5
|
||||||
|
22-62-6.75-98.5-34.75-3.75-3-6.375-6.625t-4.25-8.75-2.25-8.5-1.5-9.875-1.375-8.75q-2.25-12.5-6.625-37.5t-7-40.375-5.875-36.875-5.5-39.5q0.75-6.5
|
||||||
|
4.375-12.125t7.875-9.375 11.25-7.5 11.5-5.625 12-4.625q31.25-11.5
|
||||||
|
78.25-16 94.75-9.25 169 12.5 38.75 11.5 53.75 30.5 4 5 4.125
|
||||||
|
12.75t-1.375 13.5z" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.4 KiB |
@@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="352" height="448" viewBox="0 0 352 448" id="bitbucket"><path fill="currentColor" d="M203.75 214.75q2 15.75-12.625 25.25t-27.875 1.5q-9.75-4.25-13.375-14.5t-.125-20.5 13-14.5q9-4.5 18.125-3t16 8.875 6.875 16.875zm27.75-5.25q-3.5-26.75-28.25-41T154 165.25q-15.75 7-25.125 22.125t-8.625 32.375q1 22.75 19.375 38.75t41.375 14q22.75-2 38-21t12.5-42zM291.25 74q-5-6.75-14-11.125t-14.5-5.5T245 54.25q-72.75-11.75-141.5.5-10.75 1.75-16.5 3t-13.75 5.5T60.75 74q7.5 7 19 11.375t18.375 5.5T120 93.75Q177 101 232 94q15.75-2 22.375-3t18.125-5.375T291.25 74zm14.25 258.75q-2 6.5-3.875 19.125t-3.5 21-7.125 17.5-14.5 14.125q-21.5 12-47.375 17.875t-50.5 5.5-50.375-4.625q-11.5-2-20.375-4.5T88.75 412 70.5 401.125t-13-15.375q-6.25-24-14.25-73l1.5-4 4.5-2.25q55.75 37 126.625 37t126.875-37q5.25 1.5 6 5.75t-1.25 11.25-2 9.25zM350.75 92.5q-6.5 41.75-27.75 163.75-1.25 7.5-6.75 14t-10.875 10T291.75 288q-63 31.5-152.5 22-62-6.75-98.5-34.75-3.75-3-6.375-6.625t-4.25-8.75-2.25-8.5-1.5-9.875T25 232.75q-2.25-12.5-6.625-37.5t-7-40.375T5.5 118 0 78.5Q.75 72 4.375 66.375T12.25 57t11.25-7.5T35 43.875t12-4.625q31.25-11.5 78.25-16 94.75-9.25 169 12.5Q333 47.25 348 66.25q4 5 4.125 12.75t-1.375 13.5z"/></svg>
|
|
||||||
|
Before Width: | Height: | Size: 1.2 KiB |
@@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448" viewBox="0 0 416 448" id="github"><path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19T128 352t-18.125-8.5-10.75-19T96 304t3.125-20.5 10.75-19T128 256t18.125 8.5 10.75 19T160 304zm160 0q0 10-3.125 20.5t-10.75 19T288 352t-18.125-8.5-10.75-19T256 304t3.125-20.5 10.75-19T288 256t18.125 8.5 10.75 19T320 304zm40 0q0-30-17.25-51T296 232q-10.25 0-48.75 5.25Q229.5 240 208 240t-39.25-2.75Q130.75 232 120 232q-29.5 0-46.75 21T56 304q0 22 8 38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0 37.25-1.75t35-7.375 30.5-15 20.25-25.75T360 304zm56-44q0 51.75-15.25 82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5T212 416q-19.5 0-35.5-.75t-36.875-3.125-38.125-7.5-34.25-12.875T37 371.5t-21.5-28.75Q0 312 0 260q0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25 30.875Q171.5 96 212 96q37 0 70 8 26.25-20.5 46.75-30.25T376 64q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34 99.5z"/></svg>
|
|
||||||
|
Before Width: | Height: | Size: 991 B |
18
docs/assets/images/icons/github.f0b8504a.svg
Normal file
18
docs/assets/images/icons/github.f0b8504a.svg
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448"
|
||||||
|
viewBox="0 0 416 448" id="__github">
|
||||||
|
<path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19-18.125
|
||||||
|
8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19 18.125-8.5
|
||||||
|
18.125 8.5 10.75 19 3.125 20.5zM320 304q0 10-3.125 20.5t-10.75
|
||||||
|
19-18.125 8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19
|
||||||
|
18.125-8.5 18.125 8.5 10.75 19 3.125 20.5zM360
|
||||||
|
304q0-30-17.25-51t-46.75-21q-10.25 0-48.75 5.25-17.75 2.75-39.25
|
||||||
|
2.75t-39.25-2.75q-38-5.25-48.75-5.25-29.5 0-46.75 21t-17.25 51q0 22 8
|
||||||
|
38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0
|
||||||
|
37.25-1.75t35-7.375 30.5-15 20.25-25.75 8-38.375zM416 260q0 51.75-15.25
|
||||||
|
82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5-41.75
|
||||||
|
1.125q-19.5 0-35.5-0.75t-36.875-3.125-38.125-7.5-34.25-12.875-30.25-20.25-21.5-28.75q-15.5-30.75-15.5-82.75
|
||||||
|
0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25
|
||||||
|
30.875q36.75-8.75 77.25-8.75 37 0 70 8 26.25-20.5
|
||||||
|
46.75-30.25t47.25-9.75q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34
|
||||||
|
99.5z" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.2 KiB |
38
docs/assets/images/icons/gitlab.6dd19c00.svg
Normal file
38
docs/assets/images/icons/gitlab.6dd19c00.svg
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="500" height="500"
|
||||||
|
viewBox="0 0 500 500" id="__gitlab">
|
||||||
|
<g transform="translate(156.197863, 1.160267)">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M93.667,473.347L93.667,473.347l90.684-279.097H2.983L93.667,
|
||||||
|
473.347L93.667,473.347z" />
|
||||||
|
</g>
|
||||||
|
<g transform="translate(28.531199, 1.160800)" opacity="0.7">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M221.333,473.345L130.649,194.25H3.557L221.333,473.345L221.333,
|
||||||
|
473.345z" />
|
||||||
|
</g>
|
||||||
|
<g transform="translate(0.088533, 0.255867)" opacity="0.5">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M32,195.155L32,195.155L4.441,279.97c-2.513,7.735,0.24,16.21,6.821,
|
||||||
|
20.99l238.514,173.29 L32,195.155L32,195.155z" />
|
||||||
|
</g>
|
||||||
|
<g transform="translate(29.421866, 280.255593)">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M2.667-84.844h127.092L75.14-252.942c-2.811-8.649-15.047-8.649-17.856,
|
||||||
|
0L2.667-84.844 L2.667-84.844z" />
|
||||||
|
</g>
|
||||||
|
<g transform="translate(247.197860, 1.160800)" opacity="0.7">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M2.667,473.345L93.351,194.25h127.092L2.667,473.345L2.667,
|
||||||
|
473.345z" />
|
||||||
|
</g>
|
||||||
|
<g transform="translate(246.307061, 0.255867)" opacity="0.5">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M221.334,195.155L221.334,195.155l27.559,84.815c2.514,7.735-0.24,
|
||||||
|
16.21-6.821,20.99 L3.557,474.25L221.334,195.155L221.334,195.155z" />
|
||||||
|
</g>
|
||||||
|
<g transform="translate(336.973725, 280.255593)">
|
||||||
|
<path fill="currentColor"
|
||||||
|
d="M130.667-84.844H3.575l54.618-168.098c2.811-8.649,15.047-8.649,
|
||||||
|
17.856,0L130.667-84.844 L130.667-84.844z" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.6 KiB |
@@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="500" height="500" viewBox="0 0 500 500" id="gitlab"><path fill="currentColor" d="M93.667 473.347l90.684-279.097H2.983l90.684 279.097z" transform="translate(156.198 1.16)"/><path fill="currentColor" d="M221.333 473.345L130.649 194.25H3.557l217.776 279.095z" transform="translate(28.531 1.16)" opacity=".7"/><path fill="currentColor" d="M32 195.155L4.441 279.97a18.773 18.773 0 0 0 6.821 20.99l238.514 173.29L32 195.155z" transform="translate(.089 .256)" opacity=".5"/><path fill="currentColor" d="M2.667-84.844h127.092L75.14-252.942c-2.811-8.649-15.047-8.649-17.856 0L2.667-84.844z" transform="translate(29.422 280.256)"/><path fill="currentColor" d="M2.667 473.345L93.351 194.25h127.092L2.667 473.345z" transform="translate(247.198 1.16)" opacity=".7"/><path fill="currentColor" d="M221.334 195.155l27.559 84.815a18.772 18.772 0 0 1-6.821 20.99L3.557 474.25l217.777-279.095z" transform="translate(246.307 .256)" opacity=".5"/><path fill="currentColor" d="M130.667-84.844H3.575l54.618-168.098c2.811-8.649 15.047-8.649 17.856 0l54.618 168.098z" transform="translate(336.974 280.256)"/></svg>
|
|
||||||
|
Before Width: | Height: | Size: 1.1 KiB |
File diff suppressed because one or more lines are too long
1
docs/assets/javascripts/application.a59e2a89.js
Normal file
1
docs/assets/javascripts/application.a59e2a89.js
Normal file
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
|||||||
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.da=function(){this.pipeline.reset(),this.pipeline.add(e.da.trimmer,e.da.stopWordFilter,e.da.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.da.stemmer))},e.da.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.da.trimmer=e.trimmerSupport.generateTrimmer(e.da.wordCharacters),e.Pipeline.registerFunction(e.da.trimmer,"trimmer-da"),e.da.stemmer=function(){var r=e.stemmerSupport.Among,i=e.stemmerSupport.SnowballProgram,n=new function(){function e(){var e,r=l.limit-l.cursor;l.cursor>=t&&(e=l.limit_backward,l.limit_backward=t,l.ket=l.cursor,l.find_among_b(a,4)?(l.bra=l.cursor,l.limit_backward=e,l.cursor=l.limit-r,l.cursor>l.limit_backward&&(l.cursor--,l.bra=l.cursor,l.slice_del())):l.limit_backward=e)}var n,t,s,o=[new r("hed",-1,1),new r("ethed",0,1),new r("ered",-1,1),new r("e",-1,1),new r("erede",3,1),new r("ende",3,1),new r("erende",5,1),new r("ene",3,1),new r("erne",3,1),new r("ere",3,1),new r("en",-1,1),new r("heden",10,1),new r("eren",10,1),new r("er",-1,1),new r("heder",13,1),new r("erer",13,1),new r("s",-1,2),new r("heds",16,1),new r("es",16,1),new r("endes",18,1),new r("erendes",19,1),new r("enes",18,1),new r("ernes",18,1),new r("eres",18,1),new r("ens",16,1),new r("hedens",24,1),new r("erens",24,1),new r("ers",16,1),new r("ets",16,1),new r("erets",28,1),new r("et",-1,1),new r("eret",30,1)],a=[new r("gd",-1,-1),new r("dt",-1,-1),new r("gt",-1,-1),new r("kt",-1,-1)],d=[new r("ig",-1,1),new r("lig",0,1),new r("elig",1,1),new r("els",-1,1),new r("løst",-1,2)],u=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,48,0,128],c=[239,254,42,3,0,0,0,0,0,0,0,0,0,0,0,0,16],l=new i;this.setCurrent=function(e){l.setCurrent(e)},this.getCurrent=function(){return l.getCurrent()},this.stem=function(){var r=l.cursor;return function(){var e,r=l.cursor+3;if(t=l.limit,0<=r&&r<=l.limit){for(n=r;;){if(e=l.cursor,l.in_grouping(u,97,248)){l.cursor=e;break}if(l.cursor=e,e>=l.limit)return;l.cursor++}for(;!l.out_grouping(u,97,248);){if(l.cursor>=l.limit)return;l.cursor++}(t=l.cursor)<n&&(t=n)}}(),l.limit_backward=r,l.cursor=l.limit,function(){var e,r;if(l.cursor>=t&&(r=l.limit_backward,l.limit_backward=t,l.ket=l.cursor,e=l.find_among_b(o,32),l.limit_backward=r,e))switch(l.bra=l.cursor,e){case 1:l.slice_del();break;case 2:l.in_grouping_b(c,97,229)&&l.slice_del()}}(),l.cursor=l.limit,e(),l.cursor=l.limit,function(){var r,i,n,s=l.limit-l.cursor;if(l.ket=l.cursor,l.eq_s_b(2,"st")&&(l.bra=l.cursor,l.eq_s_b(2,"ig")&&l.slice_del()),l.cursor=l.limit-s,l.cursor>=t&&(i=l.limit_backward,l.limit_backward=t,l.ket=l.cursor,r=l.find_among_b(d,5),l.limit_backward=i,r))switch(l.bra=l.cursor,r){case 1:l.slice_del(),n=l.limit-l.cursor,e(),l.cursor=l.limit-n;break;case 2:l.slice_from("løs")}}(),l.cursor=l.limit,function(){var e;l.cursor>=t&&(e=l.limit_backward,l.limit_backward=t,l.ket=l.cursor,l.out_grouping_b(u,97,248)?(l.bra=l.cursor,s=l.slice_to(s),l.limit_backward=e,l.eq_v_b(s)&&l.slice_del()):l.limit_backward=e)}(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return n.setCurrent(e),n.stem(),n.getCurrent()}):(n.setCurrent(e),n.stem(),n.getCurrent())}}(),e.Pipeline.registerFunction(e.da.stemmer,"stemmer-da"),e.da.stopWordFilter=e.generateStopWordFilter("ad af alle alt anden at blev blive bliver da de dem den denne der deres det dette dig din disse dog du efter eller en end er et for fra ham han hans har havde have hende hendes her hos hun hvad hvis hvor i ikke ind jeg jer jo kunne man mange med meget men mig min mine mit mod ned noget nogle nu når og også om op os over på selv sig sin sine sit skal skulle som sådan thi til ud under var vi vil ville vor være været".split(" ")),e.Pipeline.registerFunction(e.da.stopWordFilter,"stopWordFilter-da")}});
|
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var r,i,n;e.da=function(){this.pipeline.reset(),this.pipeline.add(e.da.trimmer,e.da.stopWordFilter,e.da.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.da.stemmer))},e.da.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.da.trimmer=e.trimmerSupport.generateTrimmer(e.da.wordCharacters),e.Pipeline.registerFunction(e.da.trimmer,"trimmer-da"),e.da.stemmer=(r=e.stemmerSupport.Among,i=e.stemmerSupport.SnowballProgram,n=new function(){var e,n,t,s=[new r("hed",-1,1),new r("ethed",0,1),new r("ered",-1,1),new r("e",-1,1),new r("erede",3,1),new r("ende",3,1),new r("erende",5,1),new r("ene",3,1),new r("erne",3,1),new r("ere",3,1),new r("en",-1,1),new r("heden",10,1),new r("eren",10,1),new r("er",-1,1),new r("heder",13,1),new r("erer",13,1),new r("s",-1,2),new r("heds",16,1),new r("es",16,1),new r("endes",18,1),new r("erendes",19,1),new r("enes",18,1),new r("ernes",18,1),new r("eres",18,1),new r("ens",16,1),new r("hedens",24,1),new r("erens",24,1),new r("ers",16,1),new r("ets",16,1),new r("erets",28,1),new r("et",-1,1),new r("eret",30,1)],o=[new r("gd",-1,-1),new r("dt",-1,-1),new r("gt",-1,-1),new r("kt",-1,-1)],a=[new r("ig",-1,1),new r("lig",0,1),new r("elig",1,1),new r("els",-1,1),new r("løst",-1,2)],d=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,48,0,128],u=[239,254,42,3,0,0,0,0,0,0,0,0,0,0,0,0,16],c=new i;function l(){var e,r=c.limit-c.cursor;c.cursor>=n&&(e=c.limit_backward,c.limit_backward=n,c.ket=c.cursor,c.find_among_b(o,4)?(c.bra=c.cursor,c.limit_backward=e,c.cursor=c.limit-r,c.cursor>c.limit_backward&&(c.cursor--,c.bra=c.cursor,c.slice_del())):c.limit_backward=e)}this.setCurrent=function(e){c.setCurrent(e)},this.getCurrent=function(){return c.getCurrent()},this.stem=function(){var r,i=c.cursor;return function(){var r,i=c.cursor+3;if(n=c.limit,0<=i&&i<=c.limit){for(e=i;;){if(r=c.cursor,c.in_grouping(d,97,248)){c.cursor=r;break}if(c.cursor=r,r>=c.limit)return;c.cursor++}for(;!c.out_grouping(d,97,248);){if(c.cursor>=c.limit)return;c.cursor++}(n=c.cursor)<e&&(n=e)}}(),c.limit_backward=i,c.cursor=c.limit,function(){var e,r;if(c.cursor>=n&&(r=c.limit_backward,c.limit_backward=n,c.ket=c.cursor,e=c.find_among_b(s,32),c.limit_backward=r,e))switch(c.bra=c.cursor,e){case 1:c.slice_del();break;case 2:c.in_grouping_b(u,97,229)&&c.slice_del()}}(),c.cursor=c.limit,l(),c.cursor=c.limit,function(){var e,r,i,t=c.limit-c.cursor;if(c.ket=c.cursor,c.eq_s_b(2,"st")&&(c.bra=c.cursor,c.eq_s_b(2,"ig")&&c.slice_del()),c.cursor=c.limit-t,c.cursor>=n&&(r=c.limit_backward,c.limit_backward=n,c.ket=c.cursor,e=c.find_among_b(a,5),c.limit_backward=r,e))switch(c.bra=c.cursor,e){case 1:c.slice_del(),i=c.limit-c.cursor,l(),c.cursor=c.limit-i;break;case 2:c.slice_from("løs")}}(),c.cursor=c.limit,c.cursor>=n&&(r=c.limit_backward,c.limit_backward=n,c.ket=c.cursor,c.out_grouping_b(d,97,248)?(c.bra=c.cursor,t=c.slice_to(t),c.limit_backward=r,c.eq_v_b(t)&&c.slice_del()):c.limit_backward=r),!0}},function(e){return"function"==typeof e.update?e.update(function(e){return n.setCurrent(e),n.stem(),n.getCurrent()}):(n.setCurrent(e),n.stem(),n.getCurrent())}),e.Pipeline.registerFunction(e.da.stemmer,"stemmer-da"),e.da.stopWordFilter=e.generateStopWordFilter("ad af alle alt anden at blev blive bliver da de dem den denne der deres det dette dig din disse dog du efter eller en end er et for fra ham han hans har havde have hende hendes her hos hun hvad hvis hvor i ikke ind jeg jer jo kunne man mange med meget men mig min mine mit mod ned noget nogle nu når og også om op os over på selv sig sin sine sit skal skulle som sådan thi til ud under var vi vil ville vor være været".split(" ")),e.Pipeline.registerFunction(e.da.stopWordFilter,"stopWordFilter-da")}});
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
|||||||
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var r="2"==e.version[0];e.jp=function(){this.pipeline.reset(),this.pipeline.add(e.jp.stopWordFilter,e.jp.stemmer),r?this.tokenizer=e.jp.tokenizer:(e.tokenizer&&(e.tokenizer=e.jp.tokenizer),this.tokenizerFn&&(this.tokenizerFn=e.jp.tokenizer))};var t=new e.TinySegmenter;e.jp.tokenizer=function(n){if(!arguments.length||null==n||void 0==n)return[];if(Array.isArray(n))return n.map(function(t){return r?new e.Token(t.toLowerCase()):t.toLowerCase()});for(var i=n.toString().toLowerCase().replace(/^\s+/,""),o=i.length-1;o>=0;o--)if(/\S/.test(i.charAt(o))){i=i.substring(0,o+1);break}return t.segment(i).filter(function(e){return!!e}).map(function(t){return r?new e.Token(t):t})},e.jp.stemmer=function(e){return e},e.Pipeline.registerFunction(e.jp.stemmer,"stemmer-jp"),e.jp.wordCharacters="一二三四五六七八九十百千万億兆一-龠々〆ヵヶぁ-んァ-ヴーア-ン゙a-zA-Za-zA-Z0-90-9",e.jp.stopWordFilter=function(t){if(-1===e.jp.stopWordFilter.stopWords.indexOf(r?t.toString():t))return t},e.jp.stopWordFilter=e.generateStopWordFilter("これ それ あれ この その あの ここ そこ あそこ こちら どこ だれ なに なん 何 私 貴方 貴方方 我々 私達 あの人 あのかた 彼女 彼 です あります おります います は が の に を で え から まで より も どの と し それで しかし".split(" ")),e.Pipeline.registerFunction(e.jp.stopWordFilter,"stopWordFilter-jp")}});
|
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var r="2"==e.version[0];e.jp=function(){this.pipeline.reset(),this.pipeline.add(e.jp.stopWordFilter,e.jp.stemmer),r?this.tokenizer=e.jp.tokenizer:(e.tokenizer&&(e.tokenizer=e.jp.tokenizer),this.tokenizerFn&&(this.tokenizerFn=e.jp.tokenizer))};var t=new e.TinySegmenter;e.jp.tokenizer=function(n){if(!arguments.length||null==n||null==n)return[];if(Array.isArray(n))return n.map(function(t){return r?new e.Token(t.toLowerCase()):t.toLowerCase()});for(var i=n.toString().toLowerCase().replace(/^\s+/,""),o=i.length-1;o>=0;o--)if(/\S/.test(i.charAt(o))){i=i.substring(0,o+1);break}return t.segment(i).filter(function(e){return!!e}).map(function(t){return r?new e.Token(t):t})},e.jp.stemmer=function(e){return e},e.Pipeline.registerFunction(e.jp.stemmer,"stemmer-jp"),e.jp.wordCharacters="一二三四五六七八九十百千万億兆一-龠々〆ヵヶぁ-んァ-ヴーア-ン゙a-zA-Za-zA-Z0-90-9",e.jp.stopWordFilter=function(t){if(-1===e.jp.stopWordFilter.stopWords.indexOf(r?t.toString():t))return t},e.jp.stopWordFilter=e.generateStopWordFilter("これ それ あれ この その あの ここ そこ あそこ こちら どこ だれ なに なん 何 私 貴方 貴方方 我々 私達 あの人 あのかた 彼女 彼 です あります おります います は が の に を で え から まで より も どの と し それで しかし".split(" ")),e.Pipeline.registerFunction(e.jp.stopWordFilter,"stopWordFilter-jp")}});
|
||||||
@@ -1 +1 @@
|
|||||||
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.no=function(){this.pipeline.reset(),this.pipeline.add(e.no.trimmer,e.no.stopWordFilter,e.no.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.no.stemmer))},e.no.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.no.trimmer=e.trimmerSupport.generateTrimmer(e.no.wordCharacters),e.Pipeline.registerFunction(e.no.trimmer,"trimmer-no"),e.no.stemmer=function(){var r=e.stemmerSupport.Among,n=e.stemmerSupport.SnowballProgram,i=new function(){var e,i,t=[new r("a",-1,1),new r("e",-1,1),new r("ede",1,1),new r("ande",1,1),new r("ende",1,1),new r("ane",1,1),new r("ene",1,1),new r("hetene",6,1),new r("erte",1,3),new r("en",-1,1),new r("heten",9,1),new r("ar",-1,1),new r("er",-1,1),new r("heter",12,1),new r("s",-1,2),new r("as",14,1),new r("es",14,1),new r("edes",16,1),new r("endes",16,1),new r("enes",16,1),new r("hetenes",19,1),new r("ens",14,1),new r("hetens",21,1),new r("ers",14,1),new r("ets",14,1),new r("et",-1,1),new r("het",25,1),new r("ert",-1,3),new r("ast",-1,1)],o=[new r("dt",-1,-1),new r("vt",-1,-1)],s=[new r("leg",-1,1),new r("eleg",0,1),new r("ig",-1,1),new r("eig",2,1),new r("lig",2,1),new r("elig",4,1),new r("els",-1,1),new r("lov",-1,1),new r("elov",7,1),new r("slov",7,1),new r("hetslov",9,1)],a=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,48,0,128],m=[119,125,149,1],u=new n;this.setCurrent=function(e){u.setCurrent(e)},this.getCurrent=function(){return u.getCurrent()},this.stem=function(){var r=u.cursor;return function(){var r,n=u.cursor+3;if(i=u.limit,0<=n||n<=u.limit){for(e=n;;){if(r=u.cursor,u.in_grouping(a,97,248)){u.cursor=r;break}if(r>=u.limit)return;u.cursor=r+1}for(;!u.out_grouping(a,97,248);){if(u.cursor>=u.limit)return;u.cursor++}(i=u.cursor)<e&&(i=e)}}(),u.limit_backward=r,u.cursor=u.limit,function(){var e,r,n;if(u.cursor>=i&&(r=u.limit_backward,u.limit_backward=i,u.ket=u.cursor,e=u.find_among_b(t,29),u.limit_backward=r,e))switch(u.bra=u.cursor,e){case 1:u.slice_del();break;case 2:n=u.limit-u.cursor,u.in_grouping_b(m,98,122)?u.slice_del():(u.cursor=u.limit-n,u.eq_s_b(1,"k")&&u.out_grouping_b(a,97,248)&&u.slice_del());break;case 3:u.slice_from("er")}}(),u.cursor=u.limit,function(){var e,r=u.limit-u.cursor;u.cursor>=i&&(e=u.limit_backward,u.limit_backward=i,u.ket=u.cursor,u.find_among_b(o,2)?(u.bra=u.cursor,u.limit_backward=e,u.cursor=u.limit-r,u.cursor>u.limit_backward&&(u.cursor--,u.bra=u.cursor,u.slice_del())):u.limit_backward=e)}(),u.cursor=u.limit,function(){var e,r;u.cursor>=i&&(r=u.limit_backward,u.limit_backward=i,u.ket=u.cursor,(e=u.find_among_b(s,11))?(u.bra=u.cursor,u.limit_backward=r,1==e&&u.slice_del()):u.limit_backward=r)}(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}}(),e.Pipeline.registerFunction(e.no.stemmer,"stemmer-no"),e.no.stopWordFilter=e.generateStopWordFilter("alle at av bare begge ble blei bli blir blitt både båe da de deg dei deim deira deires dem den denne der dere deres det dette di din disse ditt du dykk dykkar då eg ein eit eitt eller elles en enn er et ett etter for fordi fra før ha hadde han hans har hennar henne hennes her hjå ho hoe honom hoss hossen hun hva hvem hver hvilke hvilken hvis hvor hvordan hvorfor i ikke ikkje ikkje ingen ingi inkje inn inni ja jeg kan kom korleis korso kun kunne kva kvar kvarhelst kven kvi kvifor man mange me med medan meg meget mellom men mi min mine mitt mot mykje ned no noe noen noka noko nokon nokor nokre nå når og også om opp oss over på samme seg selv si si sia sidan siden sin sine sitt sjøl skal skulle slik so som som somme somt så sånn til um upp ut uten var vart varte ved vere verte vi vil ville vore vors vort vår være være vært å".split(" ")),e.Pipeline.registerFunction(e.no.stopWordFilter,"stopWordFilter-no")}});
|
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var r,n,i;e.no=function(){this.pipeline.reset(),this.pipeline.add(e.no.trimmer,e.no.stopWordFilter,e.no.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.no.stemmer))},e.no.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.no.trimmer=e.trimmerSupport.generateTrimmer(e.no.wordCharacters),e.Pipeline.registerFunction(e.no.trimmer,"trimmer-no"),e.no.stemmer=(r=e.stemmerSupport.Among,n=e.stemmerSupport.SnowballProgram,i=new function(){var e,i,t=[new r("a",-1,1),new r("e",-1,1),new r("ede",1,1),new r("ande",1,1),new r("ende",1,1),new r("ane",1,1),new r("ene",1,1),new r("hetene",6,1),new r("erte",1,3),new r("en",-1,1),new r("heten",9,1),new r("ar",-1,1),new r("er",-1,1),new r("heter",12,1),new r("s",-1,2),new r("as",14,1),new r("es",14,1),new r("edes",16,1),new r("endes",16,1),new r("enes",16,1),new r("hetenes",19,1),new r("ens",14,1),new r("hetens",21,1),new r("ers",14,1),new r("ets",14,1),new r("et",-1,1),new r("het",25,1),new r("ert",-1,3),new r("ast",-1,1)],o=[new r("dt",-1,-1),new r("vt",-1,-1)],s=[new r("leg",-1,1),new r("eleg",0,1),new r("ig",-1,1),new r("eig",2,1),new r("lig",2,1),new r("elig",4,1),new r("els",-1,1),new r("lov",-1,1),new r("elov",7,1),new r("slov",7,1),new r("hetslov",9,1)],a=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,48,0,128],m=[119,125,149,1],l=new n;this.setCurrent=function(e){l.setCurrent(e)},this.getCurrent=function(){return l.getCurrent()},this.stem=function(){var r,n,u,d,c=l.cursor;return function(){var r,n=l.cursor+3;if(i=l.limit,0<=n||n<=l.limit){for(e=n;;){if(r=l.cursor,l.in_grouping(a,97,248)){l.cursor=r;break}if(r>=l.limit)return;l.cursor=r+1}for(;!l.out_grouping(a,97,248);){if(l.cursor>=l.limit)return;l.cursor++}(i=l.cursor)<e&&(i=e)}}(),l.limit_backward=c,l.cursor=l.limit,function(){var e,r,n;if(l.cursor>=i&&(r=l.limit_backward,l.limit_backward=i,l.ket=l.cursor,e=l.find_among_b(t,29),l.limit_backward=r,e))switch(l.bra=l.cursor,e){case 1:l.slice_del();break;case 2:n=l.limit-l.cursor,l.in_grouping_b(m,98,122)?l.slice_del():(l.cursor=l.limit-n,l.eq_s_b(1,"k")&&l.out_grouping_b(a,97,248)&&l.slice_del());break;case 3:l.slice_from("er")}}(),l.cursor=l.limit,n=l.limit-l.cursor,l.cursor>=i&&(r=l.limit_backward,l.limit_backward=i,l.ket=l.cursor,l.find_among_b(o,2)?(l.bra=l.cursor,l.limit_backward=r,l.cursor=l.limit-n,l.cursor>l.limit_backward&&(l.cursor--,l.bra=l.cursor,l.slice_del())):l.limit_backward=r),l.cursor=l.limit,l.cursor>=i&&(d=l.limit_backward,l.limit_backward=i,l.ket=l.cursor,(u=l.find_among_b(s,11))?(l.bra=l.cursor,l.limit_backward=d,1==u&&l.slice_del()):l.limit_backward=d),!0}},function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}),e.Pipeline.registerFunction(e.no.stemmer,"stemmer-no"),e.no.stopWordFilter=e.generateStopWordFilter("alle at av bare begge ble blei bli blir blitt både båe da de deg dei deim deira deires dem den denne der dere deres det dette di din disse ditt du dykk dykkar då eg ein eit eitt eller elles en enn er et ett etter for fordi fra før ha hadde han hans har hennar henne hennes her hjå ho hoe honom hoss hossen hun hva hvem hver hvilke hvilken hvis hvor hvordan hvorfor i ikke ikkje ikkje ingen ingi inkje inn inni ja jeg kan kom korleis korso kun kunne kva kvar kvarhelst kven kvi kvifor man mange me med medan meg meget mellom men mi min mine mitt mot mykje ned no noe noen noka noko nokon nokor nokre nå når og også om opp oss over på samme seg selv si si sia sidan siden sin sine sitt sjøl skal skulle slik so som som somme somt så sånn til um upp ut uten var vart varte ved vere verte vi vil ville vore vors vort vår være være vært å".split(" ")),e.Pipeline.registerFunction(e.no.stopWordFilter,"stopWordFilter-no")}});
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
|||||||
!function(r,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():t()(r.lunr)}(this,function(){return function(r){r.stemmerSupport={Among:function(r,t,i,s){if(this.toCharArray=function(r){for(var t=r.length,i=new Array(t),s=0;s<t;s++)i[s]=r.charCodeAt(s);return i},!r&&""!=r||!t&&0!=t||!i)throw"Bad Among initialisation: s:"+r+", substring_i: "+t+", result: "+i;this.s_size=r.length,this.s=this.toCharArray(r),this.substring_i=t,this.result=i,this.method=s},SnowballProgram:function(){var r;return{bra:0,ket:0,limit:0,cursor:0,limit_backward:0,setCurrent:function(t){r=t,this.cursor=0,this.limit=t.length,this.limit_backward=0,this.bra=this.cursor,this.ket=this.limit},getCurrent:function(){var t=r;return r=null,t},in_grouping:function(t,i,s){if(this.cursor<this.limit){var e=r.charCodeAt(this.cursor);if(e<=s&&e>=i&&(e-=i,t[e>>3]&1<<(7&e)))return this.cursor++,!0}return!1},in_grouping_b:function(t,i,s){if(this.cursor>this.limit_backward){var e=r.charCodeAt(this.cursor-1);if(e<=s&&e>=i&&(e-=i,t[e>>3]&1<<(7&e)))return this.cursor--,!0}return!1},out_grouping:function(t,i,s){if(this.cursor<this.limit){var e=r.charCodeAt(this.cursor);if(e>s||e<i)return this.cursor++,!0;if(e-=i,!(t[e>>3]&1<<(7&e)))return this.cursor++,!0}return!1},out_grouping_b:function(t,i,s){if(this.cursor>this.limit_backward){var e=r.charCodeAt(this.cursor-1);if(e>s||e<i)return this.cursor--,!0;if(e-=i,!(t[e>>3]&1<<(7&e)))return this.cursor--,!0}return!1},eq_s:function(t,i){if(this.limit-this.cursor<t)return!1;for(var s=0;s<t;s++)if(r.charCodeAt(this.cursor+s)!=i.charCodeAt(s))return!1;return this.cursor+=t,!0},eq_s_b:function(t,i){if(this.cursor-this.limit_backward<t)return!1;for(var s=0;s<t;s++)if(r.charCodeAt(this.cursor-t+s)!=i.charCodeAt(s))return!1;return this.cursor-=t,!0},find_among:function(t,i){for(var s=0,e=i,n=this.cursor,u=this.limit,o=0,h=0,c=!1;;){for(var a=s+(e-s>>1),f=0,l=o<h?o:h,_=t[a],m=l;m<_.s_size;m++){if(n+l==u){f=-1;break}if(f=r.charCodeAt(n+l)-_.s[m])break;l++}if(f<0?(e=a,h=l):(s=a,o=l),e-s<=1){if(s>0||e==s||c)break;c=!0}}for(;;){if(o>=(_=t[s]).s_size){if(this.cursor=n+_.s_size,!_.method)return _.result;var b=_.method();if(this.cursor=n+_.s_size,b)return _.result}if((s=_.substring_i)<0)return 0}},find_among_b:function(t,i){for(var s=0,e=i,n=this.cursor,u=this.limit_backward,o=0,h=0,c=!1;;){for(var a=s+(e-s>>1),f=0,l=o<h?o:h,_=(m=t[a]).s_size-1-l;_>=0;_--){if(n-l==u){f=-1;break}if(f=r.charCodeAt(n-1-l)-m.s[_])break;l++}if(f<0?(e=a,h=l):(s=a,o=l),e-s<=1){if(s>0||e==s||c)break;c=!0}}for(;;){var m=t[s];if(o>=m.s_size){if(this.cursor=n-m.s_size,!m.method)return m.result;var b=m.method();if(this.cursor=n-m.s_size,b)return m.result}if((s=m.substring_i)<0)return 0}},replace_s:function(t,i,s){var e=s.length-(i-t),n=r.substring(0,t),u=r.substring(i);return r=n+s+u,this.limit+=e,this.cursor>=i?this.cursor+=e:this.cursor>t&&(this.cursor=t),e},slice_check:function(){if(this.bra<0||this.bra>this.ket||this.ket>this.limit||this.limit>r.length)throw"faulty slice operation"},slice_from:function(r){this.slice_check(),this.replace_s(this.bra,this.ket,r)},slice_del:function(){this.slice_from("")},insert:function(r,t,i){var s=this.replace_s(r,t,i);r<=this.bra&&(this.bra+=s),r<=this.ket&&(this.ket+=s)},slice_to:function(){return this.slice_check(),r.substring(this.bra,this.ket)},eq_v_b:function(r){return this.eq_s_b(r.length,r)}}}},r.trimmerSupport={generateTrimmer:function(r){var t=new RegExp("^[^"+r+"]+"),i=new RegExp("[^"+r+"]+$");return function(r){return"function"==typeof r.update?r.update(function(r){return r.replace(t,"").replace(i,"")}):r.replace(t,"").replace(i,"")}}}}});
|
!function(r,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():t()(r.lunr)}(this,function(){return function(r){r.stemmerSupport={Among:function(r,t,i,s){if(this.toCharArray=function(r){for(var t=r.length,i=new Array(t),s=0;s<t;s++)i[s]=r.charCodeAt(s);return i},!r&&""!=r||!t&&0!=t||!i)throw"Bad Among initialisation: s:"+r+", substring_i: "+t+", result: "+i;this.s_size=r.length,this.s=this.toCharArray(r),this.substring_i=t,this.result=i,this.method=s},SnowballProgram:function(){var r;return{bra:0,ket:0,limit:0,cursor:0,limit_backward:0,setCurrent:function(t){r=t,this.cursor=0,this.limit=t.length,this.limit_backward=0,this.bra=this.cursor,this.ket=this.limit},getCurrent:function(){var t=r;return r=null,t},in_grouping:function(t,i,s){if(this.cursor<this.limit){var e=r.charCodeAt(this.cursor);if(e<=s&&e>=i&&t[(e-=i)>>3]&1<<(7&e))return this.cursor++,!0}return!1},in_grouping_b:function(t,i,s){if(this.cursor>this.limit_backward){var e=r.charCodeAt(this.cursor-1);if(e<=s&&e>=i&&t[(e-=i)>>3]&1<<(7&e))return this.cursor--,!0}return!1},out_grouping:function(t,i,s){if(this.cursor<this.limit){var e=r.charCodeAt(this.cursor);if(e>s||e<i)return this.cursor++,!0;if(!(t[(e-=i)>>3]&1<<(7&e)))return this.cursor++,!0}return!1},out_grouping_b:function(t,i,s){if(this.cursor>this.limit_backward){var e=r.charCodeAt(this.cursor-1);if(e>s||e<i)return this.cursor--,!0;if(!(t[(e-=i)>>3]&1<<(7&e)))return this.cursor--,!0}return!1},eq_s:function(t,i){if(this.limit-this.cursor<t)return!1;for(var s=0;s<t;s++)if(r.charCodeAt(this.cursor+s)!=i.charCodeAt(s))return!1;return this.cursor+=t,!0},eq_s_b:function(t,i){if(this.cursor-this.limit_backward<t)return!1;for(var s=0;s<t;s++)if(r.charCodeAt(this.cursor-t+s)!=i.charCodeAt(s))return!1;return this.cursor-=t,!0},find_among:function(t,i){for(var s=0,e=i,n=this.cursor,u=this.limit,o=0,h=0,c=!1;;){for(var a=s+(e-s>>1),f=0,l=o<h?o:h,_=t[a],m=l;m<_.s_size;m++){if(n+l==u){f=-1;break}if(f=r.charCodeAt(n+l)-_.s[m])break;l++}if(f<0?(e=a,h=l):(s=a,o=l),e-s<=1){if(s>0||e==s||c)break;c=!0}}for(;;){if(o>=(_=t[s]).s_size){if(this.cursor=n+_.s_size,!_.method)return _.result;var b=_.method();if(this.cursor=n+_.s_size,b)return _.result}if((s=_.substring_i)<0)return 0}},find_among_b:function(t,i){for(var s=0,e=i,n=this.cursor,u=this.limit_backward,o=0,h=0,c=!1;;){for(var a=s+(e-s>>1),f=0,l=o<h?o:h,_=(m=t[a]).s_size-1-l;_>=0;_--){if(n-l==u){f=-1;break}if(f=r.charCodeAt(n-1-l)-m.s[_])break;l++}if(f<0?(e=a,h=l):(s=a,o=l),e-s<=1){if(s>0||e==s||c)break;c=!0}}for(;;){var m;if(o>=(m=t[s]).s_size){if(this.cursor=n-m.s_size,!m.method)return m.result;var b=m.method();if(this.cursor=n-m.s_size,b)return m.result}if((s=m.substring_i)<0)return 0}},replace_s:function(t,i,s){var e=s.length-(i-t),n=r.substring(0,t),u=r.substring(i);return r=n+s+u,this.limit+=e,this.cursor>=i?this.cursor+=e:this.cursor>t&&(this.cursor=t),e},slice_check:function(){if(this.bra<0||this.bra>this.ket||this.ket>this.limit||this.limit>r.length)throw"faulty slice operation"},slice_from:function(r){this.slice_check(),this.replace_s(this.bra,this.ket,r)},slice_del:function(){this.slice_from("")},insert:function(r,t,i){var s=this.replace_s(r,t,i);r<=this.bra&&(this.bra+=s),r<=this.ket&&(this.ket+=s)},slice_to:function(){return this.slice_check(),r.substring(this.bra,this.ket)},eq_v_b:function(r){return this.eq_s_b(r.length,r)}}}},r.trimmerSupport={generateTrimmer:function(r){var t=new RegExp("^[^"+r+"]+"),i=new RegExp("[^"+r+"]+$");return function(r){return"function"==typeof r.update?r.update(function(r){return r.replace(t,"").replace(i,"")}):r.replace(t,"").replace(i,"")}}}}});
|
||||||
@@ -1 +1 @@
|
|||||||
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.sv=function(){this.pipeline.reset(),this.pipeline.add(e.sv.trimmer,e.sv.stopWordFilter,e.sv.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.sv.stemmer))},e.sv.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.sv.trimmer=e.trimmerSupport.generateTrimmer(e.sv.wordCharacters),e.Pipeline.registerFunction(e.sv.trimmer,"trimmer-sv"),e.sv.stemmer=function(){var r=e.stemmerSupport.Among,n=e.stemmerSupport.SnowballProgram,t=new function(){var e,t,i=[new r("a",-1,1),new r("arna",0,1),new r("erna",0,1),new r("heterna",2,1),new r("orna",0,1),new r("ad",-1,1),new r("e",-1,1),new r("ade",6,1),new r("ande",6,1),new r("arne",6,1),new r("are",6,1),new r("aste",6,1),new r("en",-1,1),new r("anden",12,1),new r("aren",12,1),new r("heten",12,1),new r("ern",-1,1),new r("ar",-1,1),new r("er",-1,1),new r("heter",18,1),new r("or",-1,1),new r("s",-1,2),new r("as",21,1),new r("arnas",22,1),new r("ernas",22,1),new r("ornas",22,1),new r("es",21,1),new r("ades",26,1),new r("andes",26,1),new r("ens",21,1),new r("arens",29,1),new r("hetens",29,1),new r("erns",21,1),new r("at",-1,1),new r("andet",-1,1),new r("het",-1,1),new r("ast",-1,1)],s=[new r("dd",-1,-1),new r("gd",-1,-1),new r("nn",-1,-1),new r("dt",-1,-1),new r("gt",-1,-1),new r("kt",-1,-1),new r("tt",-1,-1)],a=[new r("ig",-1,1),new r("lig",0,1),new r("els",-1,1),new r("fullt",-1,3),new r("löst",-1,2)],o=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,24,0,32],u=[119,127,149],c=new n;this.setCurrent=function(e){c.setCurrent(e)},this.getCurrent=function(){return c.getCurrent()},this.stem=function(){var r=c.cursor;return function(){var r,n=c.cursor+3;if(t=c.limit,0<=n||n<=c.limit){for(e=n;;){if(r=c.cursor,c.in_grouping(o,97,246)){c.cursor=r;break}if(c.cursor=r,c.cursor>=c.limit)return;c.cursor++}for(;!c.out_grouping(o,97,246);){if(c.cursor>=c.limit)return;c.cursor++}(t=c.cursor)<e&&(t=e)}}(),c.limit_backward=r,c.cursor=c.limit,function(){var e,r=c.limit_backward;if(c.cursor>=t&&(c.limit_backward=t,c.cursor=c.limit,c.ket=c.cursor,e=c.find_among_b(i,37),c.limit_backward=r,e))switch(c.bra=c.cursor,e){case 1:c.slice_del();break;case 2:c.in_grouping_b(u,98,121)&&c.slice_del()}}(),c.cursor=c.limit,function(){var e=c.limit_backward;c.cursor>=t&&(c.limit_backward=t,c.cursor=c.limit,c.find_among_b(s,7)&&(c.cursor=c.limit,c.ket=c.cursor,c.cursor>c.limit_backward&&(c.bra=--c.cursor,c.slice_del())),c.limit_backward=e)}(),c.cursor=c.limit,function(){var e,r;if(c.cursor>=t){if(r=c.limit_backward,c.limit_backward=t,c.cursor=c.limit,c.ket=c.cursor,e=c.find_among_b(a,5))switch(c.bra=c.cursor,e){case 1:c.slice_del();break;case 2:c.slice_from("lös");break;case 3:c.slice_from("full")}c.limit_backward=r}}(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return t.setCurrent(e),t.stem(),t.getCurrent()}):(t.setCurrent(e),t.stem(),t.getCurrent())}}(),e.Pipeline.registerFunction(e.sv.stemmer,"stemmer-sv"),e.sv.stopWordFilter=e.generateStopWordFilter("alla allt att av blev bli blir blivit de dem den denna deras dess dessa det detta dig din dina ditt du där då efter ej eller en er era ert ett från för ha hade han hans har henne hennes hon honom hur här i icke ingen inom inte jag ju kan kunde man med mellan men mig min mina mitt mot mycket ni nu när någon något några och om oss på samma sedan sig sin sina sitta själv skulle som så sådan sådana sådant till under upp ut utan vad var vara varför varit varje vars vart vem vi vid vilka vilkas vilken vilket vår våra vårt än är åt över".split(" ")),e.Pipeline.registerFunction(e.sv.stopWordFilter,"stopWordFilter-sv")}});
|
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var r,n,t;e.sv=function(){this.pipeline.reset(),this.pipeline.add(e.sv.trimmer,e.sv.stopWordFilter,e.sv.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.sv.stemmer))},e.sv.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.sv.trimmer=e.trimmerSupport.generateTrimmer(e.sv.wordCharacters),e.Pipeline.registerFunction(e.sv.trimmer,"trimmer-sv"),e.sv.stemmer=(r=e.stemmerSupport.Among,n=e.stemmerSupport.SnowballProgram,t=new function(){var e,t,i=[new r("a",-1,1),new r("arna",0,1),new r("erna",0,1),new r("heterna",2,1),new r("orna",0,1),new r("ad",-1,1),new r("e",-1,1),new r("ade",6,1),new r("ande",6,1),new r("arne",6,1),new r("are",6,1),new r("aste",6,1),new r("en",-1,1),new r("anden",12,1),new r("aren",12,1),new r("heten",12,1),new r("ern",-1,1),new r("ar",-1,1),new r("er",-1,1),new r("heter",18,1),new r("or",-1,1),new r("s",-1,2),new r("as",21,1),new r("arnas",22,1),new r("ernas",22,1),new r("ornas",22,1),new r("es",21,1),new r("ades",26,1),new r("andes",26,1),new r("ens",21,1),new r("arens",29,1),new r("hetens",29,1),new r("erns",21,1),new r("at",-1,1),new r("andet",-1,1),new r("het",-1,1),new r("ast",-1,1)],s=[new r("dd",-1,-1),new r("gd",-1,-1),new r("nn",-1,-1),new r("dt",-1,-1),new r("gt",-1,-1),new r("kt",-1,-1),new r("tt",-1,-1)],a=[new r("ig",-1,1),new r("lig",0,1),new r("els",-1,1),new r("fullt",-1,3),new r("löst",-1,2)],o=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,24,0,32],u=[119,127,149],m=new n;this.setCurrent=function(e){m.setCurrent(e)},this.getCurrent=function(){return m.getCurrent()},this.stem=function(){var r,n=m.cursor;return function(){var r,n=m.cursor+3;if(t=m.limit,0<=n||n<=m.limit){for(e=n;;){if(r=m.cursor,m.in_grouping(o,97,246)){m.cursor=r;break}if(m.cursor=r,m.cursor>=m.limit)return;m.cursor++}for(;!m.out_grouping(o,97,246);){if(m.cursor>=m.limit)return;m.cursor++}(t=m.cursor)<e&&(t=e)}}(),m.limit_backward=n,m.cursor=m.limit,function(){var e,r=m.limit_backward;if(m.cursor>=t&&(m.limit_backward=t,m.cursor=m.limit,m.ket=m.cursor,e=m.find_among_b(i,37),m.limit_backward=r,e))switch(m.bra=m.cursor,e){case 1:m.slice_del();break;case 2:m.in_grouping_b(u,98,121)&&m.slice_del()}}(),m.cursor=m.limit,r=m.limit_backward,m.cursor>=t&&(m.limit_backward=t,m.cursor=m.limit,m.find_among_b(s,7)&&(m.cursor=m.limit,m.ket=m.cursor,m.cursor>m.limit_backward&&(m.bra=--m.cursor,m.slice_del())),m.limit_backward=r),m.cursor=m.limit,function(){var e,r;if(m.cursor>=t){if(r=m.limit_backward,m.limit_backward=t,m.cursor=m.limit,m.ket=m.cursor,e=m.find_among_b(a,5))switch(m.bra=m.cursor,e){case 1:m.slice_del();break;case 2:m.slice_from("lös");break;case 3:m.slice_from("full")}m.limit_backward=r}}(),!0}},function(e){return"function"==typeof e.update?e.update(function(e){return t.setCurrent(e),t.stem(),t.getCurrent()}):(t.setCurrent(e),t.stem(),t.getCurrent())}),e.Pipeline.registerFunction(e.sv.stemmer,"stemmer-sv"),e.sv.stopWordFilter=e.generateStopWordFilter("alla allt att av blev bli blir blivit de dem den denna deras dess dessa det detta dig din dina ditt du där då efter ej eller en er era ert ett från för ha hade han hans har henne hennes hon honom hur här i icke ingen inom inte jag ju kan kunde man med mellan men mig min mina mitt mot mycket ni nu när någon något några och om oss på samma sedan sig sin sina sitta själv skulle som så sådan sådana sådant till under upp ut utan vad var vara varför varit varje vars vart vem vi vid vilka vilkas vilken vilket vår våra vårt än är åt över".split(" ")),e.Pipeline.registerFunction(e.sv.stopWordFilter,"stopWordFilter-sv")}});
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
docs/assets/stylesheets/application-palette.6079476c.css
Normal file
2
docs/assets/stylesheets/application-palette.6079476c.css
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
docs/assets/stylesheets/application.ba0fd1a6.css
Normal file
2
docs/assets/stylesheets/application.ba0fd1a6.css
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -19,6 +19,10 @@
|
|||||||
|
|
||||||
<meta name="lang:search.language" content="en">
|
<meta name="lang:search.language" content="en">
|
||||||
|
|
||||||
|
<meta name="lang:search.pipeline.stopwords" content="True">
|
||||||
|
|
||||||
|
<meta name="lang:search.pipeline.trimmer" content="True">
|
||||||
|
|
||||||
<meta name="lang:search.result.none" content="No matching documents">
|
<meta name="lang:search.result.none" content="No matching documents">
|
||||||
|
|
||||||
<meta name="lang:search.result.one" content="1 matching document">
|
<meta name="lang:search.result.one" content="1 matching document">
|
||||||
@@ -28,7 +32,7 @@
|
|||||||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||||
|
|
||||||
<link rel="shortcut icon" href="../assets/images/favicon.png">
|
<link rel="shortcut icon" href="../assets/images/favicon.png">
|
||||||
<meta name="generator" content="mkdocs-0.17.2, mkdocs-material-2.2.5">
|
<meta name="generator" content="mkdocs-0.17.5, mkdocs-material-2.9.2">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -36,36 +40,60 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../assets/stylesheets/application.bcabdff3.css">
|
<link rel="stylesheet" href="../assets/stylesheets/application.ba0fd1a6.css">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script src="../assets/javascripts/modernizr.1aa3b519.js"></script>
|
<script src="../assets/javascripts/modernizr.1aa3b519.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
|
||||||
|
|
||||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
|
||||||
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
|
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
|
||||||
|
|
||||||
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
|
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="../assets/fonts/material-icons.css">
|
||||||
|
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body dir="ltr">
|
||||||
|
|
||||||
<svg class="md-svg">
|
<svg class="md-svg">
|
||||||
<defs>
|
<defs>
|
||||||
|
|
||||||
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448" viewBox="0 0 416 448" id="github"><path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19T128 352t-18.125-8.5-10.75-19T96 304t3.125-20.5 10.75-19T128 256t18.125 8.5 10.75 19T160 304zm160 0q0 10-3.125 20.5t-10.75 19T288 352t-18.125-8.5-10.75-19T256 304t3.125-20.5 10.75-19T288 256t18.125 8.5 10.75 19T320 304zm40 0q0-30-17.25-51T296 232q-10.25 0-48.75 5.25Q229.5 240 208 240t-39.25-2.75Q130.75 232 120 232q-29.5 0-46.75 21T56 304q0 22 8 38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0 37.25-1.75t35-7.375 30.5-15 20.25-25.75T360 304zm56-44q0 51.75-15.25 82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5T212 416q-19.5 0-35.5-.75t-36.875-3.125-38.125-7.5-34.25-12.875T37 371.5t-21.5-28.75Q0 312 0 260q0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25 30.875Q171.5 96 212 96q37 0 70 8 26.25-20.5 46.75-30.25T376 64q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34 99.5z"/></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448"
|
||||||
|
viewBox="0 0 416 448" id="__github">
|
||||||
|
<path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19-18.125
|
||||||
|
8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19 18.125-8.5
|
||||||
|
18.125 8.5 10.75 19 3.125 20.5zM320 304q0 10-3.125 20.5t-10.75
|
||||||
|
19-18.125 8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19
|
||||||
|
18.125-8.5 18.125 8.5 10.75 19 3.125 20.5zM360
|
||||||
|
304q0-30-17.25-51t-46.75-21q-10.25 0-48.75 5.25-17.75 2.75-39.25
|
||||||
|
2.75t-39.25-2.75q-38-5.25-48.75-5.25-29.5 0-46.75 21t-17.25 51q0 22 8
|
||||||
|
38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0
|
||||||
|
37.25-1.75t35-7.375 30.5-15 20.25-25.75 8-38.375zM416 260q0 51.75-15.25
|
||||||
|
82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5-41.75
|
||||||
|
1.125q-19.5 0-35.5-0.75t-36.875-3.125-38.125-7.5-34.25-12.875-30.25-20.25-21.5-28.75q-15.5-30.75-15.5-82.75
|
||||||
|
0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25
|
||||||
|
30.875q36.75-8.75 77.25-8.75 37 0 70 8 26.25-20.5
|
||||||
|
46.75-30.25t47.25-9.75q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34
|
||||||
|
99.5z" />
|
||||||
|
</svg>
|
||||||
|
|
||||||
</defs>
|
</defs>
|
||||||
</svg>
|
</svg>
|
||||||
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="drawer">
|
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
|
||||||
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="search">
|
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
|
||||||
<label class="md-overlay" data-md-component="overlay" for="drawer"></label>
|
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
|
||||||
|
|
||||||
|
<a href="#yaml-to-json" tabindex="1" class="md-skip">
|
||||||
|
Skip to content
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
<header class="md-header" data-md-component="header">
|
<header class="md-header" data-md-component="header">
|
||||||
<nav class="md-header-nav md-grid">
|
<nav class="md-header-nav md-grid">
|
||||||
@@ -78,7 +106,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="md-flex__cell md-flex__cell--shrink">
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
<label class="md-icon md-icon--menu md-header-nav__button" for="drawer"></label>
|
<label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
|
||||||
</div>
|
</div>
|
||||||
<div class="md-flex__cell md-flex__cell--stretch">
|
<div class="md-flex__cell md-flex__cell--stretch">
|
||||||
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
||||||
@@ -97,15 +125,17 @@
|
|||||||
<div class="md-flex__cell md-flex__cell--shrink">
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
|
||||||
|
|
||||||
<label class="md-icon md-icon--search md-header-nav__button" for="search"></label>
|
<label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
|
||||||
|
|
||||||
<div class="md-search" data-md-component="search" role="dialog">
|
<div class="md-search" data-md-component="search" role="dialog">
|
||||||
<label class="md-search__overlay" for="search"></label>
|
<label class="md-search__overlay" for="__search"></label>
|
||||||
<div class="md-search__inner">
|
<div class="md-search__inner" role="search">
|
||||||
<form class="md-search__form" name="search">
|
<form class="md-search__form" name="search">
|
||||||
<input type="text" class="md-search__input" name="query" required placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query">
|
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
|
||||||
<label class="md-icon md-search__icon" for="search"></label>
|
<label class="md-icon md-search__icon" for="__search"></label>
|
||||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset"></button>
|
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||||
|

|
||||||
|
</button>
|
||||||
</form>
|
</form>
|
||||||
<div class="md-search__output">
|
<div class="md-search__output">
|
||||||
<div class="md-search__scrollwrap" data-md-scrollfix>
|
<div class="md-search__scrollwrap" data-md-scrollfix>
|
||||||
@@ -135,7 +165,7 @@
|
|||||||
|
|
||||||
<div class="md-source__icon">
|
<div class="md-source__icon">
|
||||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||||
<use xlink:href="#github" width="24" height="24"></use>
|
<use xlink:href="#__github" width="24" height="24"></use>
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -164,7 +194,7 @@
|
|||||||
<div class="md-sidebar__scrollwrap">
|
<div class="md-sidebar__scrollwrap">
|
||||||
<div class="md-sidebar__inner">
|
<div class="md-sidebar__inner">
|
||||||
<nav class="md-nav md-nav--primary" data-md-level="0">
|
<nav class="md-nav md-nav--primary" data-md-level="0">
|
||||||
<label class="md-nav__title md-nav__title--site" for="drawer">
|
<label class="md-nav__title md-nav__title--site" for="__drawer">
|
||||||
<span class="md-nav__button md-logo">
|
<span class="md-nav__button md-logo">
|
||||||
|
|
||||||
<i class="md-icon"></i>
|
<i class="md-icon"></i>
|
||||||
@@ -184,7 +214,7 @@
|
|||||||
|
|
||||||
<div class="md-source__icon">
|
<div class="md-source__icon">
|
||||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||||
<use xlink:href="#github" width="24" height="24"></use>
|
<use xlink:href="#__github" width="24" height="24"></use>
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -266,10 +296,10 @@
|
|||||||
|
|
||||||
<li class="md-nav__item md-nav__item--active">
|
<li class="md-nav__item md-nav__item--active">
|
||||||
|
|
||||||
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="toc">
|
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc">
|
||||||
|
|
||||||
|
|
||||||
<label class="md-nav__link md-nav__link--active" for="toc">
|
<label class="md-nav__link md-nav__link--active" for="__toc">
|
||||||
Convert
|
Convert
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
@@ -282,7 +312,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<label class="md-nav__title" for="toc">Table of contents</label>
|
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||||
<ul class="md-nav__list" data-md-scrollfix>
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
<li class="md-nav__item">
|
<li class="md-nav__item">
|
||||||
@@ -301,6 +331,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</nav>
|
</nav>
|
||||||
@@ -335,7 +367,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<label class="md-nav__title" for="toc">Table of contents</label>
|
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||||
<ul class="md-nav__list" data-md-scrollfix>
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
<li class="md-nav__item">
|
<li class="md-nav__item">
|
||||||
@@ -354,6 +386,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</nav>
|
</nav>
|
||||||
@@ -372,7 +406,7 @@
|
|||||||
<h1>Convert</h1>
|
<h1>Convert</h1>
|
||||||
|
|
||||||
<h3 id="yaml-to-json">Yaml to Json<a class="headerlink" href="#yaml-to-json" title="Permanent link">¶</a></h3>
|
<h3 id="yaml-to-json">Yaml to Json<a class="headerlink" href="#yaml-to-json" title="Permanent link">¶</a></h3>
|
||||||
<p>To convert output to json, use the --tojson (or -j) flag. This can be used with any command.</p>
|
<p>To convert output to json, use the --tojson (or -j) flag. This can only be used with the read command.</p>
|
||||||
<p>Given a sample.yaml file of:</p>
|
<p>Given a sample.yaml file of:</p>
|
||||||
<pre><code class="yaml">b:
|
<pre><code class="yaml">b:
|
||||||
c: 2
|
c: 2
|
||||||
@@ -410,6 +444,8 @@ b:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
@@ -459,7 +495,7 @@ b:
|
|||||||
<div class="md-footer-copyright">
|
<div class="md-footer-copyright">
|
||||||
|
|
||||||
powered by
|
powered by
|
||||||
<a href="http://www.mkdocs.org">MkDocs</a>
|
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||||
and
|
and
|
||||||
<a href="https://squidfunk.github.io/mkdocs-material/">
|
<a href="https://squidfunk.github.io/mkdocs-material/">
|
||||||
Material for MkDocs</a>
|
Material for MkDocs</a>
|
||||||
@@ -467,8 +503,7 @@ b:
|
|||||||
|
|
||||||
|
|
||||||
<div class="md-footer-social">
|
<div class="md-footer-social">
|
||||||
|
<link rel="stylesheet" href="../assets/fonts/font-awesome.css">
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
|
||||||
|
|
||||||
<a href="https://github.com/mikefarah" class="md-footer-social__link fa fa-github"></a>
|
<a href="https://github.com/mikefarah" class="md-footer-social__link fa fa-github"></a>
|
||||||
|
|
||||||
@@ -483,9 +518,9 @@ b:
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="../assets/javascripts/application.6cdc17f0.js"></script>
|
<script src="../assets/javascripts/application.a59e2a89.js"></script>
|
||||||
|
|
||||||
<script>app.initialize({version:"0.17.2",url:{base:".."}})</script>
|
<script>app.initialize({version:"0.17.5",url:{base:".."}})</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,10 @@
|
|||||||
|
|
||||||
<meta name="lang:search.language" content="en">
|
<meta name="lang:search.language" content="en">
|
||||||
|
|
||||||
|
<meta name="lang:search.pipeline.stopwords" content="True">
|
||||||
|
|
||||||
|
<meta name="lang:search.pipeline.trimmer" content="True">
|
||||||
|
|
||||||
<meta name="lang:search.result.none" content="No matching documents">
|
<meta name="lang:search.result.none" content="No matching documents">
|
||||||
|
|
||||||
<meta name="lang:search.result.one" content="1 matching document">
|
<meta name="lang:search.result.one" content="1 matching document">
|
||||||
@@ -28,7 +32,7 @@
|
|||||||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||||
|
|
||||||
<link rel="shortcut icon" href="../assets/images/favicon.png">
|
<link rel="shortcut icon" href="../assets/images/favicon.png">
|
||||||
<meta name="generator" content="mkdocs-0.17.2, mkdocs-material-2.2.5">
|
<meta name="generator" content="mkdocs-0.17.5, mkdocs-material-2.9.2">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -36,36 +40,60 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../assets/stylesheets/application.bcabdff3.css">
|
<link rel="stylesheet" href="../assets/stylesheets/application.ba0fd1a6.css">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script src="../assets/javascripts/modernizr.1aa3b519.js"></script>
|
<script src="../assets/javascripts/modernizr.1aa3b519.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
|
||||||
|
|
||||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
|
||||||
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
|
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
|
||||||
|
|
||||||
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
|
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="../assets/fonts/material-icons.css">
|
||||||
|
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body dir="ltr">
|
||||||
|
|
||||||
<svg class="md-svg">
|
<svg class="md-svg">
|
||||||
<defs>
|
<defs>
|
||||||
|
|
||||||
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448" viewBox="0 0 416 448" id="github"><path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19T128 352t-18.125-8.5-10.75-19T96 304t3.125-20.5 10.75-19T128 256t18.125 8.5 10.75 19T160 304zm160 0q0 10-3.125 20.5t-10.75 19T288 352t-18.125-8.5-10.75-19T256 304t3.125-20.5 10.75-19T288 256t18.125 8.5 10.75 19T320 304zm40 0q0-30-17.25-51T296 232q-10.25 0-48.75 5.25Q229.5 240 208 240t-39.25-2.75Q130.75 232 120 232q-29.5 0-46.75 21T56 304q0 22 8 38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0 37.25-1.75t35-7.375 30.5-15 20.25-25.75T360 304zm56-44q0 51.75-15.25 82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5T212 416q-19.5 0-35.5-.75t-36.875-3.125-38.125-7.5-34.25-12.875T37 371.5t-21.5-28.75Q0 312 0 260q0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25 30.875Q171.5 96 212 96q37 0 70 8 26.25-20.5 46.75-30.25T376 64q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34 99.5z"/></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448"
|
||||||
|
viewBox="0 0 416 448" id="__github">
|
||||||
|
<path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19-18.125
|
||||||
|
8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19 18.125-8.5
|
||||||
|
18.125 8.5 10.75 19 3.125 20.5zM320 304q0 10-3.125 20.5t-10.75
|
||||||
|
19-18.125 8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19
|
||||||
|
18.125-8.5 18.125 8.5 10.75 19 3.125 20.5zM360
|
||||||
|
304q0-30-17.25-51t-46.75-21q-10.25 0-48.75 5.25-17.75 2.75-39.25
|
||||||
|
2.75t-39.25-2.75q-38-5.25-48.75-5.25-29.5 0-46.75 21t-17.25 51q0 22 8
|
||||||
|
38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0
|
||||||
|
37.25-1.75t35-7.375 30.5-15 20.25-25.75 8-38.375zM416 260q0 51.75-15.25
|
||||||
|
82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5-41.75
|
||||||
|
1.125q-19.5 0-35.5-0.75t-36.875-3.125-38.125-7.5-34.25-12.875-30.25-20.25-21.5-28.75q-15.5-30.75-15.5-82.75
|
||||||
|
0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25
|
||||||
|
30.875q36.75-8.75 77.25-8.75 37 0 70 8 26.25-20.5
|
||||||
|
46.75-30.25t47.25-9.75q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34
|
||||||
|
99.5z" />
|
||||||
|
</svg>
|
||||||
|
|
||||||
</defs>
|
</defs>
|
||||||
</svg>
|
</svg>
|
||||||
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="drawer">
|
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
|
||||||
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="search">
|
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
|
||||||
<label class="md-overlay" data-md-component="overlay" for="drawer"></label>
|
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
|
||||||
|
|
||||||
|
<a href="#creating-a-simple-yaml-file" tabindex="1" class="md-skip">
|
||||||
|
Skip to content
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
<header class="md-header" data-md-component="header">
|
<header class="md-header" data-md-component="header">
|
||||||
<nav class="md-header-nav md-grid">
|
<nav class="md-header-nav md-grid">
|
||||||
@@ -78,7 +106,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="md-flex__cell md-flex__cell--shrink">
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
<label class="md-icon md-icon--menu md-header-nav__button" for="drawer"></label>
|
<label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
|
||||||
</div>
|
</div>
|
||||||
<div class="md-flex__cell md-flex__cell--stretch">
|
<div class="md-flex__cell md-flex__cell--stretch">
|
||||||
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
||||||
@@ -97,15 +125,17 @@
|
|||||||
<div class="md-flex__cell md-flex__cell--shrink">
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
|
||||||
|
|
||||||
<label class="md-icon md-icon--search md-header-nav__button" for="search"></label>
|
<label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
|
||||||
|
|
||||||
<div class="md-search" data-md-component="search" role="dialog">
|
<div class="md-search" data-md-component="search" role="dialog">
|
||||||
<label class="md-search__overlay" for="search"></label>
|
<label class="md-search__overlay" for="__search"></label>
|
||||||
<div class="md-search__inner">
|
<div class="md-search__inner" role="search">
|
||||||
<form class="md-search__form" name="search">
|
<form class="md-search__form" name="search">
|
||||||
<input type="text" class="md-search__input" name="query" required placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query">
|
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
|
||||||
<label class="md-icon md-search__icon" for="search"></label>
|
<label class="md-icon md-search__icon" for="__search"></label>
|
||||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset"></button>
|
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||||
|

|
||||||
|
</button>
|
||||||
</form>
|
</form>
|
||||||
<div class="md-search__output">
|
<div class="md-search__output">
|
||||||
<div class="md-search__scrollwrap" data-md-scrollfix>
|
<div class="md-search__scrollwrap" data-md-scrollfix>
|
||||||
@@ -135,7 +165,7 @@
|
|||||||
|
|
||||||
<div class="md-source__icon">
|
<div class="md-source__icon">
|
||||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||||
<use xlink:href="#github" width="24" height="24"></use>
|
<use xlink:href="#__github" width="24" height="24"></use>
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -164,7 +194,7 @@
|
|||||||
<div class="md-sidebar__scrollwrap">
|
<div class="md-sidebar__scrollwrap">
|
||||||
<div class="md-sidebar__inner">
|
<div class="md-sidebar__inner">
|
||||||
<nav class="md-nav md-nav--primary" data-md-level="0">
|
<nav class="md-nav md-nav--primary" data-md-level="0">
|
||||||
<label class="md-nav__title md-nav__title--site" for="drawer">
|
<label class="md-nav__title md-nav__title--site" for="__drawer">
|
||||||
<span class="md-nav__button md-logo">
|
<span class="md-nav__button md-logo">
|
||||||
|
|
||||||
<i class="md-icon"></i>
|
<i class="md-icon"></i>
|
||||||
@@ -184,7 +214,7 @@
|
|||||||
|
|
||||||
<div class="md-source__icon">
|
<div class="md-source__icon">
|
||||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||||
<use xlink:href="#github" width="24" height="24"></use>
|
<use xlink:href="#__github" width="24" height="24"></use>
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -254,10 +284,10 @@
|
|||||||
|
|
||||||
<li class="md-nav__item md-nav__item--active">
|
<li class="md-nav__item md-nav__item--active">
|
||||||
|
|
||||||
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="toc">
|
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc">
|
||||||
|
|
||||||
|
|
||||||
<label class="md-nav__link md-nav__link--active" for="toc">
|
<label class="md-nav__link md-nav__link--active" for="__toc">
|
||||||
Create
|
Create
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
@@ -270,7 +300,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<label class="md-nav__title" for="toc">Table of contents</label>
|
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||||
<ul class="md-nav__list" data-md-scrollfix>
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
<li class="md-nav__item">
|
<li class="md-nav__item">
|
||||||
@@ -296,6 +326,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</nav>
|
</nav>
|
||||||
@@ -342,7 +374,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<label class="md-nav__title" for="toc">Table of contents</label>
|
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||||
<ul class="md-nav__list" data-md-scrollfix>
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
<li class="md-nav__item">
|
<li class="md-nav__item">
|
||||||
@@ -368,6 +400,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</nav>
|
</nav>
|
||||||
@@ -385,7 +419,7 @@
|
|||||||
|
|
||||||
<h1>Create</h1>
|
<h1>Create</h1>
|
||||||
|
|
||||||
<p>Yaml files can be created using the 'new' command. This works in the same way as the write command, but you don't pass in an existing Yaml file.</p>
|
<p>Yaml files can be created using the 'new' command. This works in the same way as the write command, but you don't pass in an existing Yaml file. Currently this does not support creating multiple documents in a single yaml file.</p>
|
||||||
<pre><code>yq n <path> <new value>
|
<pre><code>yq n <path> <new value>
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
@@ -440,6 +474,8 @@ b.e[0].name: Howdy Partner
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
@@ -489,7 +525,7 @@ b.e[0].name: Howdy Partner
|
|||||||
<div class="md-footer-copyright">
|
<div class="md-footer-copyright">
|
||||||
|
|
||||||
powered by
|
powered by
|
||||||
<a href="http://www.mkdocs.org">MkDocs</a>
|
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||||
and
|
and
|
||||||
<a href="https://squidfunk.github.io/mkdocs-material/">
|
<a href="https://squidfunk.github.io/mkdocs-material/">
|
||||||
Material for MkDocs</a>
|
Material for MkDocs</a>
|
||||||
@@ -497,8 +533,7 @@ b.e[0].name: Howdy Partner
|
|||||||
|
|
||||||
|
|
||||||
<div class="md-footer-social">
|
<div class="md-footer-social">
|
||||||
|
<link rel="stylesheet" href="../assets/fonts/font-awesome.css">
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
|
||||||
|
|
||||||
<a href="https://github.com/mikefarah" class="md-footer-social__link fa fa-github"></a>
|
<a href="https://github.com/mikefarah" class="md-footer-social__link fa fa-github"></a>
|
||||||
|
|
||||||
@@ -513,9 +548,9 @@ b.e[0].name: Howdy Partner
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="../assets/javascripts/application.6cdc17f0.js"></script>
|
<script src="../assets/javascripts/application.a59e2a89.js"></script>
|
||||||
|
|
||||||
<script>app.initialize({version:"0.17.2",url:{base:".."}})</script>
|
<script>app.initialize({version:"0.17.5",url:{base:".."}})</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,10 @@
|
|||||||
|
|
||||||
<meta name="lang:search.language" content="en">
|
<meta name="lang:search.language" content="en">
|
||||||
|
|
||||||
|
<meta name="lang:search.pipeline.stopwords" content="True">
|
||||||
|
|
||||||
|
<meta name="lang:search.pipeline.trimmer" content="True">
|
||||||
|
|
||||||
<meta name="lang:search.result.none" content="No matching documents">
|
<meta name="lang:search.result.none" content="No matching documents">
|
||||||
|
|
||||||
<meta name="lang:search.result.one" content="1 matching document">
|
<meta name="lang:search.result.one" content="1 matching document">
|
||||||
@@ -28,7 +32,7 @@
|
|||||||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||||
|
|
||||||
<link rel="shortcut icon" href="../assets/images/favicon.png">
|
<link rel="shortcut icon" href="../assets/images/favicon.png">
|
||||||
<meta name="generator" content="mkdocs-0.17.2, mkdocs-material-2.2.5">
|
<meta name="generator" content="mkdocs-0.17.5, mkdocs-material-2.9.2">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -36,36 +40,60 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../assets/stylesheets/application.bcabdff3.css">
|
<link rel="stylesheet" href="../assets/stylesheets/application.ba0fd1a6.css">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script src="../assets/javascripts/modernizr.1aa3b519.js"></script>
|
<script src="../assets/javascripts/modernizr.1aa3b519.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
|
||||||
|
|
||||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
|
||||||
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
|
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
|
||||||
|
|
||||||
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
|
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="../assets/fonts/material-icons.css">
|
||||||
|
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body dir="ltr">
|
||||||
|
|
||||||
<svg class="md-svg">
|
<svg class="md-svg">
|
||||||
<defs>
|
<defs>
|
||||||
|
|
||||||
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448" viewBox="0 0 416 448" id="github"><path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19T128 352t-18.125-8.5-10.75-19T96 304t3.125-20.5 10.75-19T128 256t18.125 8.5 10.75 19T160 304zm160 0q0 10-3.125 20.5t-10.75 19T288 352t-18.125-8.5-10.75-19T256 304t3.125-20.5 10.75-19T288 256t18.125 8.5 10.75 19T320 304zm40 0q0-30-17.25-51T296 232q-10.25 0-48.75 5.25Q229.5 240 208 240t-39.25-2.75Q130.75 232 120 232q-29.5 0-46.75 21T56 304q0 22 8 38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0 37.25-1.75t35-7.375 30.5-15 20.25-25.75T360 304zm56-44q0 51.75-15.25 82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5T212 416q-19.5 0-35.5-.75t-36.875-3.125-38.125-7.5-34.25-12.875T37 371.5t-21.5-28.75Q0 312 0 260q0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25 30.875Q171.5 96 212 96q37 0 70 8 26.25-20.5 46.75-30.25T376 64q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34 99.5z"/></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448"
|
||||||
|
viewBox="0 0 416 448" id="__github">
|
||||||
|
<path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19-18.125
|
||||||
|
8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19 18.125-8.5
|
||||||
|
18.125 8.5 10.75 19 3.125 20.5zM320 304q0 10-3.125 20.5t-10.75
|
||||||
|
19-18.125 8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19
|
||||||
|
18.125-8.5 18.125 8.5 10.75 19 3.125 20.5zM360
|
||||||
|
304q0-30-17.25-51t-46.75-21q-10.25 0-48.75 5.25-17.75 2.75-39.25
|
||||||
|
2.75t-39.25-2.75q-38-5.25-48.75-5.25-29.5 0-46.75 21t-17.25 51q0 22 8
|
||||||
|
38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0
|
||||||
|
37.25-1.75t35-7.375 30.5-15 20.25-25.75 8-38.375zM416 260q0 51.75-15.25
|
||||||
|
82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5-41.75
|
||||||
|
1.125q-19.5 0-35.5-0.75t-36.875-3.125-38.125-7.5-34.25-12.875-30.25-20.25-21.5-28.75q-15.5-30.75-15.5-82.75
|
||||||
|
0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25
|
||||||
|
30.875q36.75-8.75 77.25-8.75 37 0 70 8 26.25-20.5
|
||||||
|
46.75-30.25t47.25-9.75q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34
|
||||||
|
99.5z" />
|
||||||
|
</svg>
|
||||||
|
|
||||||
</defs>
|
</defs>
|
||||||
</svg>
|
</svg>
|
||||||
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="drawer">
|
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
|
||||||
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="search">
|
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
|
||||||
<label class="md-overlay" data-md-component="overlay" for="drawer"></label>
|
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
|
||||||
|
|
||||||
|
<a href="#to-stdout" tabindex="1" class="md-skip">
|
||||||
|
Skip to content
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
<header class="md-header" data-md-component="header">
|
<header class="md-header" data-md-component="header">
|
||||||
<nav class="md-header-nav md-grid">
|
<nav class="md-header-nav md-grid">
|
||||||
@@ -78,7 +106,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="md-flex__cell md-flex__cell--shrink">
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
<label class="md-icon md-icon--menu md-header-nav__button" for="drawer"></label>
|
<label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
|
||||||
</div>
|
</div>
|
||||||
<div class="md-flex__cell md-flex__cell--stretch">
|
<div class="md-flex__cell md-flex__cell--stretch">
|
||||||
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
||||||
@@ -97,15 +125,17 @@
|
|||||||
<div class="md-flex__cell md-flex__cell--shrink">
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
|
||||||
|
|
||||||
<label class="md-icon md-icon--search md-header-nav__button" for="search"></label>
|
<label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
|
||||||
|
|
||||||
<div class="md-search" data-md-component="search" role="dialog">
|
<div class="md-search" data-md-component="search" role="dialog">
|
||||||
<label class="md-search__overlay" for="search"></label>
|
<label class="md-search__overlay" for="__search"></label>
|
||||||
<div class="md-search__inner">
|
<div class="md-search__inner" role="search">
|
||||||
<form class="md-search__form" name="search">
|
<form class="md-search__form" name="search">
|
||||||
<input type="text" class="md-search__input" name="query" required placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query">
|
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
|
||||||
<label class="md-icon md-search__icon" for="search"></label>
|
<label class="md-icon md-search__icon" for="__search"></label>
|
||||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset"></button>
|
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||||
|

|
||||||
|
</button>
|
||||||
</form>
|
</form>
|
||||||
<div class="md-search__output">
|
<div class="md-search__output">
|
||||||
<div class="md-search__scrollwrap" data-md-scrollfix>
|
<div class="md-search__scrollwrap" data-md-scrollfix>
|
||||||
@@ -135,7 +165,7 @@
|
|||||||
|
|
||||||
<div class="md-source__icon">
|
<div class="md-source__icon">
|
||||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||||
<use xlink:href="#github" width="24" height="24"></use>
|
<use xlink:href="#__github" width="24" height="24"></use>
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -164,7 +194,7 @@
|
|||||||
<div class="md-sidebar__scrollwrap">
|
<div class="md-sidebar__scrollwrap">
|
||||||
<div class="md-sidebar__inner">
|
<div class="md-sidebar__inner">
|
||||||
<nav class="md-nav md-nav--primary" data-md-level="0">
|
<nav class="md-nav md-nav--primary" data-md-level="0">
|
||||||
<label class="md-nav__title md-nav__title--site" for="drawer">
|
<label class="md-nav__title md-nav__title--site" for="__drawer">
|
||||||
<span class="md-nav__button md-logo">
|
<span class="md-nav__button md-logo">
|
||||||
|
|
||||||
<i class="md-icon"></i>
|
<i class="md-icon"></i>
|
||||||
@@ -184,7 +214,7 @@
|
|||||||
|
|
||||||
<div class="md-source__icon">
|
<div class="md-source__icon">
|
||||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||||
<use xlink:href="#github" width="24" height="24"></use>
|
<use xlink:href="#__github" width="24" height="24"></use>
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -242,10 +272,10 @@
|
|||||||
|
|
||||||
<li class="md-nav__item md-nav__item--active">
|
<li class="md-nav__item md-nav__item--active">
|
||||||
|
|
||||||
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="toc">
|
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc">
|
||||||
|
|
||||||
|
|
||||||
<label class="md-nav__link md-nav__link--active" for="toc">
|
<label class="md-nav__link md-nav__link--active" for="__toc">
|
||||||
Delete
|
Delete
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
@@ -258,7 +288,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<label class="md-nav__title" for="toc">Table of contents</label>
|
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||||
<ul class="md-nav__list" data-md-scrollfix>
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
<li class="md-nav__item">
|
<li class="md-nav__item">
|
||||||
@@ -287,6 +317,20 @@
|
|||||||
Deleting nodes in-place
|
Deleting nodes in-place
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#multiple-documents-delete-from-single-document" title="Multiple Documents - delete from single document" class="md-nav__link">
|
||||||
|
Multiple Documents - delete from single document
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#multiple-documents-delete-from-all-documents" title="Multiple Documents - delete from all documents" class="md-nav__link">
|
||||||
|
Multiple Documents - delete from all documents
|
||||||
|
</a>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="md-nav__item">
|
<li class="md-nav__item">
|
||||||
@@ -298,6 +342,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</nav>
|
</nav>
|
||||||
@@ -356,7 +402,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<label class="md-nav__title" for="toc">Table of contents</label>
|
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||||
<ul class="md-nav__list" data-md-scrollfix>
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
<li class="md-nav__item">
|
<li class="md-nav__item">
|
||||||
@@ -385,6 +431,20 @@
|
|||||||
Deleting nodes in-place
|
Deleting nodes in-place
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#multiple-documents-delete-from-single-document" title="Multiple Documents - delete from single document" class="md-nav__link">
|
||||||
|
Multiple Documents - delete from single document
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#multiple-documents-delete-from-all-documents" title="Multiple Documents - delete from all documents" class="md-nav__link">
|
||||||
|
Multiple Documents - delete from all documents
|
||||||
|
</a>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="md-nav__item">
|
<li class="md-nav__item">
|
||||||
@@ -396,6 +456,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</nav>
|
</nav>
|
||||||
@@ -413,10 +475,9 @@
|
|||||||
|
|
||||||
<h1>Delete</h1>
|
<h1>Delete</h1>
|
||||||
|
|
||||||
<pre><code>yq d <yaml_file|json_file> <path_to_delete>
|
<pre><code>yq d <yaml_file> <path_to_delete>
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>This command can take a json file as input too, and will output yaml unless specified to export as json (-j)</p>
|
|
||||||
<h3 id="to-stdout">To Stdout<a class="headerlink" href="#to-stdout" title="Permanent link">¶</a></h3>
|
<h3 id="to-stdout">To Stdout<a class="headerlink" href="#to-stdout" title="Permanent link">¶</a></h3>
|
||||||
<p>Given a sample.yaml file of:</p>
|
<p>Given a sample.yaml file of:</p>
|
||||||
<pre><code class="yaml">b:
|
<pre><code class="yaml">b:
|
||||||
@@ -469,6 +530,50 @@
|
|||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>will update the sample.yaml file so that the 'c' node is deleted</p>
|
<p>will update the sample.yaml file so that the 'c' node is deleted</p>
|
||||||
|
<h3 id="multiple-documents-delete-from-single-document">Multiple Documents - delete from single document<a class="headerlink" href="#multiple-documents-delete-from-single-document" title="Permanent link">¶</a></h3>
|
||||||
|
<p>Given a sample.yaml file of:</p>
|
||||||
|
<pre><code class="yaml">something: else
|
||||||
|
field: leaveMe
|
||||||
|
---
|
||||||
|
b:
|
||||||
|
c: 2
|
||||||
|
field: deleteMe
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>then</p>
|
||||||
|
<pre><code class="bash">yq w -d1 sample.yaml field
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>will output:</p>
|
||||||
|
<pre><code class="yaml">something: else
|
||||||
|
field: leaveMe
|
||||||
|
---
|
||||||
|
b:
|
||||||
|
c: 2
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<h3 id="multiple-documents-delete-from-all-documents">Multiple Documents - delete from all documents<a class="headerlink" href="#multiple-documents-delete-from-all-documents" title="Permanent link">¶</a></h3>
|
||||||
|
<p>Given a sample.yaml file of:</p>
|
||||||
|
<pre><code class="yaml">something: else
|
||||||
|
field: deleteMe
|
||||||
|
---
|
||||||
|
b:
|
||||||
|
c: 2
|
||||||
|
field: deleteMeToo
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>then</p>
|
||||||
|
<pre><code class="bash">yq w -d'*' sample.yaml field
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>will output:</p>
|
||||||
|
<pre><code class="yaml">something: else
|
||||||
|
---
|
||||||
|
b:
|
||||||
|
c: 2
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>Note that '*' is in quotes to avoid being interpreted by your shell.</p>
|
||||||
<h3 id="keys-with-dots">Keys with dots<a class="headerlink" href="#keys-with-dots" title="Permanent link">¶</a></h3>
|
<h3 id="keys-with-dots">Keys with dots<a class="headerlink" href="#keys-with-dots" title="Permanent link">¶</a></h3>
|
||||||
<p>When specifying a key that has a dot use key lookup indicator.</p>
|
<p>When specifying a key that has a dot use key lookup indicator.</p>
|
||||||
<pre><code class="yaml">b:
|
<pre><code class="yaml">b:
|
||||||
@@ -489,6 +594,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
@@ -538,7 +645,7 @@
|
|||||||
<div class="md-footer-copyright">
|
<div class="md-footer-copyright">
|
||||||
|
|
||||||
powered by
|
powered by
|
||||||
<a href="http://www.mkdocs.org">MkDocs</a>
|
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||||
and
|
and
|
||||||
<a href="https://squidfunk.github.io/mkdocs-material/">
|
<a href="https://squidfunk.github.io/mkdocs-material/">
|
||||||
Material for MkDocs</a>
|
Material for MkDocs</a>
|
||||||
@@ -546,8 +653,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<div class="md-footer-social">
|
<div class="md-footer-social">
|
||||||
|
<link rel="stylesheet" href="../assets/fonts/font-awesome.css">
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
|
||||||
|
|
||||||
<a href="https://github.com/mikefarah" class="md-footer-social__link fa fa-github"></a>
|
<a href="https://github.com/mikefarah" class="md-footer-social__link fa fa-github"></a>
|
||||||
|
|
||||||
@@ -562,9 +668,9 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="../assets/javascripts/application.6cdc17f0.js"></script>
|
<script src="../assets/javascripts/application.a59e2a89.js"></script>
|
||||||
|
|
||||||
<script>app.initialize({version:"0.17.2",url:{base:".."}})</script>
|
<script>app.initialize({version:"0.17.5",url:{base:".."}})</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,10 @@
|
|||||||
|
|
||||||
<meta name="lang:search.language" content="en">
|
<meta name="lang:search.language" content="en">
|
||||||
|
|
||||||
|
<meta name="lang:search.pipeline.stopwords" content="True">
|
||||||
|
|
||||||
|
<meta name="lang:search.pipeline.trimmer" content="True">
|
||||||
|
|
||||||
<meta name="lang:search.result.none" content="No matching documents">
|
<meta name="lang:search.result.none" content="No matching documents">
|
||||||
|
|
||||||
<meta name="lang:search.result.one" content="1 matching document">
|
<meta name="lang:search.result.one" content="1 matching document">
|
||||||
@@ -28,7 +32,7 @@
|
|||||||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||||
|
|
||||||
<link rel="shortcut icon" href="./assets/images/favicon.png">
|
<link rel="shortcut icon" href="./assets/images/favicon.png">
|
||||||
<meta name="generator" content="mkdocs-0.17.2, mkdocs-material-2.2.5">
|
<meta name="generator" content="mkdocs-0.17.5, mkdocs-material-2.9.2">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -36,36 +40,60 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="./assets/stylesheets/application.bcabdff3.css">
|
<link rel="stylesheet" href="./assets/stylesheets/application.ba0fd1a6.css">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script src="./assets/javascripts/modernizr.1aa3b519.js"></script>
|
<script src="./assets/javascripts/modernizr.1aa3b519.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
|
||||||
|
|
||||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
|
||||||
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
|
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
|
||||||
|
|
||||||
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
|
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="./assets/fonts/material-icons.css">
|
||||||
|
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body dir="ltr">
|
||||||
|
|
||||||
<svg class="md-svg">
|
<svg class="md-svg">
|
||||||
<defs>
|
<defs>
|
||||||
|
|
||||||
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448" viewBox="0 0 416 448" id="github"><path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19T128 352t-18.125-8.5-10.75-19T96 304t3.125-20.5 10.75-19T128 256t18.125 8.5 10.75 19T160 304zm160 0q0 10-3.125 20.5t-10.75 19T288 352t-18.125-8.5-10.75-19T256 304t3.125-20.5 10.75-19T288 256t18.125 8.5 10.75 19T320 304zm40 0q0-30-17.25-51T296 232q-10.25 0-48.75 5.25Q229.5 240 208 240t-39.25-2.75Q130.75 232 120 232q-29.5 0-46.75 21T56 304q0 22 8 38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0 37.25-1.75t35-7.375 30.5-15 20.25-25.75T360 304zm56-44q0 51.75-15.25 82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5T212 416q-19.5 0-35.5-.75t-36.875-3.125-38.125-7.5-34.25-12.875T37 371.5t-21.5-28.75Q0 312 0 260q0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25 30.875Q171.5 96 212 96q37 0 70 8 26.25-20.5 46.75-30.25T376 64q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34 99.5z"/></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448"
|
||||||
|
viewBox="0 0 416 448" id="__github">
|
||||||
|
<path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19-18.125
|
||||||
|
8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19 18.125-8.5
|
||||||
|
18.125 8.5 10.75 19 3.125 20.5zM320 304q0 10-3.125 20.5t-10.75
|
||||||
|
19-18.125 8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19
|
||||||
|
18.125-8.5 18.125 8.5 10.75 19 3.125 20.5zM360
|
||||||
|
304q0-30-17.25-51t-46.75-21q-10.25 0-48.75 5.25-17.75 2.75-39.25
|
||||||
|
2.75t-39.25-2.75q-38-5.25-48.75-5.25-29.5 0-46.75 21t-17.25 51q0 22 8
|
||||||
|
38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0
|
||||||
|
37.25-1.75t35-7.375 30.5-15 20.25-25.75 8-38.375zM416 260q0 51.75-15.25
|
||||||
|
82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5-41.75
|
||||||
|
1.125q-19.5 0-35.5-0.75t-36.875-3.125-38.125-7.5-34.25-12.875-30.25-20.25-21.5-28.75q-15.5-30.75-15.5-82.75
|
||||||
|
0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25
|
||||||
|
30.875q36.75-8.75 77.25-8.75 37 0 70 8 26.25-20.5
|
||||||
|
46.75-30.25t47.25-9.75q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34
|
||||||
|
99.5z" />
|
||||||
|
</svg>
|
||||||
|
|
||||||
</defs>
|
</defs>
|
||||||
</svg>
|
</svg>
|
||||||
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="drawer">
|
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
|
||||||
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="search">
|
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
|
||||||
<label class="md-overlay" data-md-component="overlay" for="drawer"></label>
|
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
|
||||||
|
|
||||||
|
<a href="#yq" tabindex="1" class="md-skip">
|
||||||
|
Skip to content
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
<header class="md-header" data-md-component="header">
|
<header class="md-header" data-md-component="header">
|
||||||
<nav class="md-header-nav md-grid">
|
<nav class="md-header-nav md-grid">
|
||||||
@@ -78,7 +106,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="md-flex__cell md-flex__cell--shrink">
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
<label class="md-icon md-icon--menu md-header-nav__button" for="drawer"></label>
|
<label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
|
||||||
</div>
|
</div>
|
||||||
<div class="md-flex__cell md-flex__cell--stretch">
|
<div class="md-flex__cell md-flex__cell--stretch">
|
||||||
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
||||||
@@ -97,15 +125,17 @@
|
|||||||
<div class="md-flex__cell md-flex__cell--shrink">
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
|
||||||
|
|
||||||
<label class="md-icon md-icon--search md-header-nav__button" for="search"></label>
|
<label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
|
||||||
|
|
||||||
<div class="md-search" data-md-component="search" role="dialog">
|
<div class="md-search" data-md-component="search" role="dialog">
|
||||||
<label class="md-search__overlay" for="search"></label>
|
<label class="md-search__overlay" for="__search"></label>
|
||||||
<div class="md-search__inner">
|
<div class="md-search__inner" role="search">
|
||||||
<form class="md-search__form" name="search">
|
<form class="md-search__form" name="search">
|
||||||
<input type="text" class="md-search__input" name="query" required placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query">
|
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
|
||||||
<label class="md-icon md-search__icon" for="search"></label>
|
<label class="md-icon md-search__icon" for="__search"></label>
|
||||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset"></button>
|
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||||
|

|
||||||
|
</button>
|
||||||
</form>
|
</form>
|
||||||
<div class="md-search__output">
|
<div class="md-search__output">
|
||||||
<div class="md-search__scrollwrap" data-md-scrollfix>
|
<div class="md-search__scrollwrap" data-md-scrollfix>
|
||||||
@@ -135,7 +165,7 @@
|
|||||||
|
|
||||||
<div class="md-source__icon">
|
<div class="md-source__icon">
|
||||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||||
<use xlink:href="#github" width="24" height="24"></use>
|
<use xlink:href="#__github" width="24" height="24"></use>
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -164,7 +194,7 @@
|
|||||||
<div class="md-sidebar__scrollwrap">
|
<div class="md-sidebar__scrollwrap">
|
||||||
<div class="md-sidebar__inner">
|
<div class="md-sidebar__inner">
|
||||||
<nav class="md-nav md-nav--primary" data-md-level="0">
|
<nav class="md-nav md-nav--primary" data-md-level="0">
|
||||||
<label class="md-nav__title md-nav__title--site" for="drawer">
|
<label class="md-nav__title md-nav__title--site" for="__drawer">
|
||||||
<span class="md-nav__button md-logo">
|
<span class="md-nav__button md-logo">
|
||||||
|
|
||||||
<i class="md-icon"></i>
|
<i class="md-icon"></i>
|
||||||
@@ -184,7 +214,7 @@
|
|||||||
|
|
||||||
<div class="md-source__icon">
|
<div class="md-source__icon">
|
||||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||||
<use xlink:href="#github" width="24" height="24"></use>
|
<use xlink:href="#__github" width="24" height="24"></use>
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -206,12 +236,12 @@
|
|||||||
|
|
||||||
<li class="md-nav__item md-nav__item--active">
|
<li class="md-nav__item md-nav__item--active">
|
||||||
|
|
||||||
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="toc">
|
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<label class="md-nav__link md-nav__link--active" for="toc">
|
<label class="md-nav__link md-nav__link--active" for="__toc">
|
||||||
Install
|
Install
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
@@ -226,7 +256,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<label class="md-nav__title" for="toc">Table of contents</label>
|
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||||
<ul class="md-nav__list" data-md-scrollfix>
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
<li class="md-nav__item">
|
<li class="md-nav__item">
|
||||||
@@ -238,6 +268,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</nav>
|
</nav>
|
||||||
@@ -334,7 +366,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<label class="md-nav__title" for="toc">Table of contents</label>
|
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||||
<ul class="md-nav__list" data-md-scrollfix>
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
<li class="md-nav__item">
|
<li class="md-nav__item">
|
||||||
@@ -346,6 +378,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</nav>
|
</nav>
|
||||||
@@ -380,7 +414,7 @@ sudo apt install yq -y
|
|||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>or, <a href="https://github.com/mikefarah/yq/releases/latest">Download latest binary</a> or alternatively:</p>
|
<p>or, <a href="https://github.com/mikefarah/yq/releases/latest">Download latest binary</a> or alternatively:</p>
|
||||||
<pre><code>go get github.com/mikefarah/yq
|
<pre><code>go get gopkg.in/mikefarah/yq.v2
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p><a href="https://github.com/mikefarah/yq">View on GitHub</a></p>
|
<p><a href="https://github.com/mikefarah/yq">View on GitHub</a></p>
|
||||||
@@ -390,6 +424,8 @@ sudo apt install yq -y
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
@@ -425,7 +461,7 @@ sudo apt install yq -y
|
|||||||
<div class="md-footer-copyright">
|
<div class="md-footer-copyright">
|
||||||
|
|
||||||
powered by
|
powered by
|
||||||
<a href="http://www.mkdocs.org">MkDocs</a>
|
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||||
and
|
and
|
||||||
<a href="https://squidfunk.github.io/mkdocs-material/">
|
<a href="https://squidfunk.github.io/mkdocs-material/">
|
||||||
Material for MkDocs</a>
|
Material for MkDocs</a>
|
||||||
@@ -433,8 +469,7 @@ sudo apt install yq -y
|
|||||||
|
|
||||||
|
|
||||||
<div class="md-footer-social">
|
<div class="md-footer-social">
|
||||||
|
<link rel="stylesheet" href="./assets/fonts/font-awesome.css">
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
|
||||||
|
|
||||||
<a href="https://github.com/mikefarah" class="md-footer-social__link fa fa-github"></a>
|
<a href="https://github.com/mikefarah" class="md-footer-social__link fa fa-github"></a>
|
||||||
|
|
||||||
@@ -449,9 +484,9 @@ sudo apt install yq -y
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="./assets/javascripts/application.6cdc17f0.js"></script>
|
<script src="./assets/javascripts/application.a59e2a89.js"></script>
|
||||||
|
|
||||||
<script>app.initialize({version:"0.17.2",url:{base:"."}})</script>
|
<script>app.initialize({version:"0.17.5",url:{base:"."}})</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,10 @@
|
|||||||
|
|
||||||
<meta name="lang:search.language" content="en">
|
<meta name="lang:search.language" content="en">
|
||||||
|
|
||||||
|
<meta name="lang:search.pipeline.stopwords" content="True">
|
||||||
|
|
||||||
|
<meta name="lang:search.pipeline.trimmer" content="True">
|
||||||
|
|
||||||
<meta name="lang:search.result.none" content="No matching documents">
|
<meta name="lang:search.result.none" content="No matching documents">
|
||||||
|
|
||||||
<meta name="lang:search.result.one" content="1 matching document">
|
<meta name="lang:search.result.one" content="1 matching document">
|
||||||
@@ -28,7 +32,7 @@
|
|||||||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||||
|
|
||||||
<link rel="shortcut icon" href="../assets/images/favicon.png">
|
<link rel="shortcut icon" href="../assets/images/favicon.png">
|
||||||
<meta name="generator" content="mkdocs-0.17.2, mkdocs-material-2.2.5">
|
<meta name="generator" content="mkdocs-0.17.5, mkdocs-material-2.9.2">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -36,36 +40,60 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../assets/stylesheets/application.bcabdff3.css">
|
<link rel="stylesheet" href="../assets/stylesheets/application.ba0fd1a6.css">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script src="../assets/javascripts/modernizr.1aa3b519.js"></script>
|
<script src="../assets/javascripts/modernizr.1aa3b519.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
|
||||||
|
|
||||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
|
||||||
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
|
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
|
||||||
|
|
||||||
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
|
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="../assets/fonts/material-icons.css">
|
||||||
|
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body dir="ltr">
|
||||||
|
|
||||||
<svg class="md-svg">
|
<svg class="md-svg">
|
||||||
<defs>
|
<defs>
|
||||||
|
|
||||||
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448" viewBox="0 0 416 448" id="github"><path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19T128 352t-18.125-8.5-10.75-19T96 304t3.125-20.5 10.75-19T128 256t18.125 8.5 10.75 19T160 304zm160 0q0 10-3.125 20.5t-10.75 19T288 352t-18.125-8.5-10.75-19T256 304t3.125-20.5 10.75-19T288 256t18.125 8.5 10.75 19T320 304zm40 0q0-30-17.25-51T296 232q-10.25 0-48.75 5.25Q229.5 240 208 240t-39.25-2.75Q130.75 232 120 232q-29.5 0-46.75 21T56 304q0 22 8 38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0 37.25-1.75t35-7.375 30.5-15 20.25-25.75T360 304zm56-44q0 51.75-15.25 82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5T212 416q-19.5 0-35.5-.75t-36.875-3.125-38.125-7.5-34.25-12.875T37 371.5t-21.5-28.75Q0 312 0 260q0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25 30.875Q171.5 96 212 96q37 0 70 8 26.25-20.5 46.75-30.25T376 64q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34 99.5z"/></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448"
|
||||||
|
viewBox="0 0 416 448" id="__github">
|
||||||
|
<path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19-18.125
|
||||||
|
8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19 18.125-8.5
|
||||||
|
18.125 8.5 10.75 19 3.125 20.5zM320 304q0 10-3.125 20.5t-10.75
|
||||||
|
19-18.125 8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19
|
||||||
|
18.125-8.5 18.125 8.5 10.75 19 3.125 20.5zM360
|
||||||
|
304q0-30-17.25-51t-46.75-21q-10.25 0-48.75 5.25-17.75 2.75-39.25
|
||||||
|
2.75t-39.25-2.75q-38-5.25-48.75-5.25-29.5 0-46.75 21t-17.25 51q0 22 8
|
||||||
|
38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0
|
||||||
|
37.25-1.75t35-7.375 30.5-15 20.25-25.75 8-38.375zM416 260q0 51.75-15.25
|
||||||
|
82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5-41.75
|
||||||
|
1.125q-19.5 0-35.5-0.75t-36.875-3.125-38.125-7.5-34.25-12.875-30.25-20.25-21.5-28.75q-15.5-30.75-15.5-82.75
|
||||||
|
0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25
|
||||||
|
30.875q36.75-8.75 77.25-8.75 37 0 70 8 26.25-20.5
|
||||||
|
46.75-30.25t47.25-9.75q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34
|
||||||
|
99.5z" />
|
||||||
|
</svg>
|
||||||
|
|
||||||
</defs>
|
</defs>
|
||||||
</svg>
|
</svg>
|
||||||
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="drawer">
|
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
|
||||||
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="search">
|
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
|
||||||
<label class="md-overlay" data-md-component="overlay" for="drawer"></label>
|
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
|
||||||
|
|
||||||
|
<a href="#to-stdout" tabindex="1" class="md-skip">
|
||||||
|
Skip to content
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
<header class="md-header" data-md-component="header">
|
<header class="md-header" data-md-component="header">
|
||||||
<nav class="md-header-nav md-grid">
|
<nav class="md-header-nav md-grid">
|
||||||
@@ -78,7 +106,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="md-flex__cell md-flex__cell--shrink">
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
<label class="md-icon md-icon--menu md-header-nav__button" for="drawer"></label>
|
<label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
|
||||||
</div>
|
</div>
|
||||||
<div class="md-flex__cell md-flex__cell--stretch">
|
<div class="md-flex__cell md-flex__cell--stretch">
|
||||||
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
||||||
@@ -97,15 +125,17 @@
|
|||||||
<div class="md-flex__cell md-flex__cell--shrink">
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
|
||||||
|
|
||||||
<label class="md-icon md-icon--search md-header-nav__button" for="search"></label>
|
<label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
|
||||||
|
|
||||||
<div class="md-search" data-md-component="search" role="dialog">
|
<div class="md-search" data-md-component="search" role="dialog">
|
||||||
<label class="md-search__overlay" for="search"></label>
|
<label class="md-search__overlay" for="__search"></label>
|
||||||
<div class="md-search__inner">
|
<div class="md-search__inner" role="search">
|
||||||
<form class="md-search__form" name="search">
|
<form class="md-search__form" name="search">
|
||||||
<input type="text" class="md-search__input" name="query" required placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query">
|
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
|
||||||
<label class="md-icon md-search__icon" for="search"></label>
|
<label class="md-icon md-search__icon" for="__search"></label>
|
||||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset"></button>
|
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||||
|

|
||||||
|
</button>
|
||||||
</form>
|
</form>
|
||||||
<div class="md-search__output">
|
<div class="md-search__output">
|
||||||
<div class="md-search__scrollwrap" data-md-scrollfix>
|
<div class="md-search__scrollwrap" data-md-scrollfix>
|
||||||
@@ -135,7 +165,7 @@
|
|||||||
|
|
||||||
<div class="md-source__icon">
|
<div class="md-source__icon">
|
||||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||||
<use xlink:href="#github" width="24" height="24"></use>
|
<use xlink:href="#__github" width="24" height="24"></use>
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -164,7 +194,7 @@
|
|||||||
<div class="md-sidebar__scrollwrap">
|
<div class="md-sidebar__scrollwrap">
|
||||||
<div class="md-sidebar__inner">
|
<div class="md-sidebar__inner">
|
||||||
<nav class="md-nav md-nav--primary" data-md-level="0">
|
<nav class="md-nav md-nav--primary" data-md-level="0">
|
||||||
<label class="md-nav__title md-nav__title--site" for="drawer">
|
<label class="md-nav__title md-nav__title--site" for="__drawer">
|
||||||
<span class="md-nav__button md-logo">
|
<span class="md-nav__button md-logo">
|
||||||
|
|
||||||
<i class="md-icon"></i>
|
<i class="md-icon"></i>
|
||||||
@@ -184,7 +214,7 @@
|
|||||||
|
|
||||||
<div class="md-source__icon">
|
<div class="md-source__icon">
|
||||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||||
<use xlink:href="#github" width="24" height="24"></use>
|
<use xlink:href="#__github" width="24" height="24"></use>
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -278,10 +308,10 @@
|
|||||||
|
|
||||||
<li class="md-nav__item md-nav__item--active">
|
<li class="md-nav__item md-nav__item--active">
|
||||||
|
|
||||||
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="toc">
|
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc">
|
||||||
|
|
||||||
|
|
||||||
<label class="md-nav__link md-nav__link--active" for="toc">
|
<label class="md-nav__link md-nav__link--active" for="__toc">
|
||||||
Merge
|
Merge
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
@@ -294,7 +324,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<label class="md-nav__title" for="toc">Table of contents</label>
|
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||||
<ul class="md-nav__list" data-md-scrollfix>
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
<li class="md-nav__item">
|
<li class="md-nav__item">
|
||||||
@@ -325,6 +355,29 @@
|
|||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#append-values-with-arrays" title="Append values with arrays" class="md-nav__link">
|
||||||
|
Append values with arrays
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#multiple-documents-merge-into-single-document" title="Multiple Documents - merge into single document" class="md-nav__link">
|
||||||
|
Multiple Documents - merge into single document
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#multiple-documents-merge-into-all-documents" title="Multiple Documents - merge into all documents" class="md-nav__link">
|
||||||
|
Multiple Documents - merge into all documents
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
@@ -349,7 +402,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<label class="md-nav__title" for="toc">Table of contents</label>
|
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||||
<ul class="md-nav__list" data-md-scrollfix>
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
<li class="md-nav__item">
|
<li class="md-nav__item">
|
||||||
@@ -380,6 +433,29 @@
|
|||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#append-values-with-arrays" title="Append values with arrays" class="md-nav__link">
|
||||||
|
Append values with arrays
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#multiple-documents-merge-into-single-document" title="Multiple Documents - merge into single document" class="md-nav__link">
|
||||||
|
Multiple Documents - merge into single document
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#multiple-documents-merge-into-all-documents" title="Multiple Documents - merge into all documents" class="md-nav__link">
|
||||||
|
Multiple Documents - merge into all documents
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
@@ -401,10 +477,9 @@
|
|||||||
|
|
||||||
<p>Yaml files can be merged using the 'merge' command. Each additional file merged with the first file will
|
<p>Yaml files can be merged using the 'merge' command. Each additional file merged with the first file will
|
||||||
set values for any key not existing already or where the key has no value.</p>
|
set values for any key not existing already or where the key has no value.</p>
|
||||||
<pre><code>yq m <yaml_file|json_file> <path>...
|
<pre><code>yq m <yaml_file> <path>...
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>This command can take a json file as input too, and will output yaml unless specified to export as json (-j)</p>
|
|
||||||
<h3 id="to-stdout">To Stdout<a class="headerlink" href="#to-stdout" title="Permanent link">¶</a></h3>
|
<h3 id="to-stdout">To Stdout<a class="headerlink" href="#to-stdout" title="Permanent link">¶</a></h3>
|
||||||
<p>Given a data1.yaml file of:</p>
|
<p>Given a data1.yaml file of:</p>
|
||||||
<pre><code class="yaml">a: simple
|
<pre><code class="yaml">a: simple
|
||||||
@@ -475,7 +550,7 @@ b: [1, 2]
|
|||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>and data3.yaml file of:</p>
|
<p>and data3.yaml file of:</p>
|
||||||
<pre><code class="yaml">b: [2, 3, 4]
|
<pre><code class="yaml">b: [3, 4]
|
||||||
c:
|
c:
|
||||||
test: 2
|
test: 2
|
||||||
other: true
|
other: true
|
||||||
@@ -488,21 +563,100 @@ d: false
|
|||||||
|
|
||||||
<p>will output:</p>
|
<p>will output:</p>
|
||||||
<pre><code class="yaml">a: simple
|
<pre><code class="yaml">a: simple
|
||||||
b: [2, 3, 4]
|
b: [3, 4]
|
||||||
c:
|
c:
|
||||||
test: 2
|
test: 2
|
||||||
other: true
|
other: true
|
||||||
d: false
|
d: false
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>Notice that 'b' does not result in the merging of the values within an array. The underlying library does not
|
<p>Notice that 'b' does not result in the merging of the values within an array. </p>
|
||||||
currently handle merging values within an array.</p>
|
<h3 id="append-values-with-arrays">Append values with arrays<a class="headerlink" href="#append-values-with-arrays" title="Permanent link">¶</a></h3>
|
||||||
|
<p>Given a data1.yaml file of:</p>
|
||||||
|
<pre><code class="yaml">a: simple
|
||||||
|
b: [1, 2]
|
||||||
|
d: hi
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>and data3.yaml file of:</p>
|
||||||
|
<pre><code class="yaml">a: something
|
||||||
|
b: [3, 4]
|
||||||
|
c:
|
||||||
|
test: 2
|
||||||
|
other: true
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>then</p>
|
||||||
|
<pre><code class="bash">yq m -a data1.yaml data3.yaml
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>will output:</p>
|
||||||
|
<pre><code class="yaml">a: simple
|
||||||
|
b: [1, 2, 3, 4]
|
||||||
|
c:
|
||||||
|
test: 2
|
||||||
|
other: true
|
||||||
|
d: hi
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>Note that the 'b' array has concatenated the values from the second data file. Also note that other map keys are not overridden (field a).</p>
|
||||||
|
<p>Append cannot be used with overwrite, if both flags are given then append is ignored.</p>
|
||||||
|
<h3 id="multiple-documents-merge-into-single-document">Multiple Documents - merge into single document<a class="headerlink" href="#multiple-documents-merge-into-single-document" title="Permanent link">¶</a></h3>
|
||||||
|
<p>Currently yq only has multi-document support for the <em>first</em> document being merged into. The remaining yaml files will have their first document selected.</p>
|
||||||
|
<p>Given a data1.yaml file of:</p>
|
||||||
|
<pre><code class="yaml">something: else
|
||||||
|
---
|
||||||
|
a: simple
|
||||||
|
b: cat
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>and data3.yaml file of:</p>
|
||||||
|
<pre><code class="yaml">b: dog
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>then</p>
|
||||||
|
<pre><code class="bash">yq m -x -d1 data1.yaml data3.yaml
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>will output:</p>
|
||||||
|
<pre><code class="yaml">something: else
|
||||||
|
---
|
||||||
|
a: simple
|
||||||
|
b: dog
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<h3 id="multiple-documents-merge-into-all-documents">Multiple Documents - merge into all documents<a class="headerlink" href="#multiple-documents-merge-into-all-documents" title="Permanent link">¶</a></h3>
|
||||||
|
<p>Currently yq only has multi-document support for the <em>first</em> document being merged into. The remaining yaml files will have their first document selected.</p>
|
||||||
|
<p>Given a data1.yaml file of:</p>
|
||||||
|
<pre><code class="yaml">something: else
|
||||||
|
---
|
||||||
|
a: simple
|
||||||
|
b: cat
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>and data3.yaml file of:</p>
|
||||||
|
<pre><code class="yaml">b: dog
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>then</p>
|
||||||
|
<pre><code class="bash">yq m -x -d'*' data1.yaml data3.yaml
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>will output:</p>
|
||||||
|
<pre><code class="yaml">b: dog
|
||||||
|
something: else
|
||||||
|
---
|
||||||
|
a: simple
|
||||||
|
b: dog
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
@@ -538,7 +692,7 @@ currently handle merging values within an array.</p>
|
|||||||
<div class="md-footer-copyright">
|
<div class="md-footer-copyright">
|
||||||
|
|
||||||
powered by
|
powered by
|
||||||
<a href="http://www.mkdocs.org">MkDocs</a>
|
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||||
and
|
and
|
||||||
<a href="https://squidfunk.github.io/mkdocs-material/">
|
<a href="https://squidfunk.github.io/mkdocs-material/">
|
||||||
Material for MkDocs</a>
|
Material for MkDocs</a>
|
||||||
@@ -546,8 +700,7 @@ currently handle merging values within an array.</p>
|
|||||||
|
|
||||||
|
|
||||||
<div class="md-footer-social">
|
<div class="md-footer-social">
|
||||||
|
<link rel="stylesheet" href="../assets/fonts/font-awesome.css">
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
|
||||||
|
|
||||||
<a href="https://github.com/mikefarah" class="md-footer-social__link fa fa-github"></a>
|
<a href="https://github.com/mikefarah" class="md-footer-social__link fa fa-github"></a>
|
||||||
|
|
||||||
@@ -562,9 +715,9 @@ currently handle merging values within an array.</p>
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="../assets/javascripts/application.6cdc17f0.js"></script>
|
<script src="../assets/javascripts/application.a59e2a89.js"></script>
|
||||||
|
|
||||||
<script>app.initialize({version:"0.17.2",url:{base:".."}})</script>
|
<script>app.initialize({version:"0.17.5",url:{base:".."}})</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,10 @@
|
|||||||
|
|
||||||
<meta name="lang:search.language" content="en">
|
<meta name="lang:search.language" content="en">
|
||||||
|
|
||||||
|
<meta name="lang:search.pipeline.stopwords" content="True">
|
||||||
|
|
||||||
|
<meta name="lang:search.pipeline.trimmer" content="True">
|
||||||
|
|
||||||
<meta name="lang:search.result.none" content="No matching documents">
|
<meta name="lang:search.result.none" content="No matching documents">
|
||||||
|
|
||||||
<meta name="lang:search.result.one" content="1 matching document">
|
<meta name="lang:search.result.one" content="1 matching document">
|
||||||
@@ -28,7 +32,7 @@
|
|||||||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||||
|
|
||||||
<link rel="shortcut icon" href="../assets/images/favicon.png">
|
<link rel="shortcut icon" href="../assets/images/favicon.png">
|
||||||
<meta name="generator" content="mkdocs-0.17.2, mkdocs-material-2.2.5">
|
<meta name="generator" content="mkdocs-0.17.5, mkdocs-material-2.9.2">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -36,36 +40,60 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../assets/stylesheets/application.bcabdff3.css">
|
<link rel="stylesheet" href="../assets/stylesheets/application.ba0fd1a6.css">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script src="../assets/javascripts/modernizr.1aa3b519.js"></script>
|
<script src="../assets/javascripts/modernizr.1aa3b519.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
|
||||||
|
|
||||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
|
||||||
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
|
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
|
||||||
|
|
||||||
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
|
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="../assets/fonts/material-icons.css">
|
||||||
|
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body dir="ltr">
|
||||||
|
|
||||||
<svg class="md-svg">
|
<svg class="md-svg">
|
||||||
<defs>
|
<defs>
|
||||||
|
|
||||||
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448" viewBox="0 0 416 448" id="github"><path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19T128 352t-18.125-8.5-10.75-19T96 304t3.125-20.5 10.75-19T128 256t18.125 8.5 10.75 19T160 304zm160 0q0 10-3.125 20.5t-10.75 19T288 352t-18.125-8.5-10.75-19T256 304t3.125-20.5 10.75-19T288 256t18.125 8.5 10.75 19T320 304zm40 0q0-30-17.25-51T296 232q-10.25 0-48.75 5.25Q229.5 240 208 240t-39.25-2.75Q130.75 232 120 232q-29.5 0-46.75 21T56 304q0 22 8 38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0 37.25-1.75t35-7.375 30.5-15 20.25-25.75T360 304zm56-44q0 51.75-15.25 82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5T212 416q-19.5 0-35.5-.75t-36.875-3.125-38.125-7.5-34.25-12.875T37 371.5t-21.5-28.75Q0 312 0 260q0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25 30.875Q171.5 96 212 96q37 0 70 8 26.25-20.5 46.75-30.25T376 64q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34 99.5z"/></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448"
|
||||||
|
viewBox="0 0 416 448" id="__github">
|
||||||
|
<path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19-18.125
|
||||||
|
8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19 18.125-8.5
|
||||||
|
18.125 8.5 10.75 19 3.125 20.5zM320 304q0 10-3.125 20.5t-10.75
|
||||||
|
19-18.125 8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19
|
||||||
|
18.125-8.5 18.125 8.5 10.75 19 3.125 20.5zM360
|
||||||
|
304q0-30-17.25-51t-46.75-21q-10.25 0-48.75 5.25-17.75 2.75-39.25
|
||||||
|
2.75t-39.25-2.75q-38-5.25-48.75-5.25-29.5 0-46.75 21t-17.25 51q0 22 8
|
||||||
|
38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0
|
||||||
|
37.25-1.75t35-7.375 30.5-15 20.25-25.75 8-38.375zM416 260q0 51.75-15.25
|
||||||
|
82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5-41.75
|
||||||
|
1.125q-19.5 0-35.5-0.75t-36.875-3.125-38.125-7.5-34.25-12.875-30.25-20.25-21.5-28.75q-15.5-30.75-15.5-82.75
|
||||||
|
0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25
|
||||||
|
30.875q36.75-8.75 77.25-8.75 37 0 70 8 26.25-20.5
|
||||||
|
46.75-30.25t47.25-9.75q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34
|
||||||
|
99.5z" />
|
||||||
|
</svg>
|
||||||
|
|
||||||
</defs>
|
</defs>
|
||||||
</svg>
|
</svg>
|
||||||
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="drawer">
|
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
|
||||||
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="search">
|
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
|
||||||
<label class="md-overlay" data-md-component="overlay" for="drawer"></label>
|
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
|
||||||
|
|
||||||
|
<a href="#basic" tabindex="1" class="md-skip">
|
||||||
|
Skip to content
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
<header class="md-header" data-md-component="header">
|
<header class="md-header" data-md-component="header">
|
||||||
<nav class="md-header-nav md-grid">
|
<nav class="md-header-nav md-grid">
|
||||||
@@ -78,7 +106,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="md-flex__cell md-flex__cell--shrink">
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
<label class="md-icon md-icon--menu md-header-nav__button" for="drawer"></label>
|
<label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
|
||||||
</div>
|
</div>
|
||||||
<div class="md-flex__cell md-flex__cell--stretch">
|
<div class="md-flex__cell md-flex__cell--stretch">
|
||||||
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
||||||
@@ -97,15 +125,17 @@
|
|||||||
<div class="md-flex__cell md-flex__cell--shrink">
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
|
||||||
|
|
||||||
<label class="md-icon md-icon--search md-header-nav__button" for="search"></label>
|
<label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
|
||||||
|
|
||||||
<div class="md-search" data-md-component="search" role="dialog">
|
<div class="md-search" data-md-component="search" role="dialog">
|
||||||
<label class="md-search__overlay" for="search"></label>
|
<label class="md-search__overlay" for="__search"></label>
|
||||||
<div class="md-search__inner">
|
<div class="md-search__inner" role="search">
|
||||||
<form class="md-search__form" name="search">
|
<form class="md-search__form" name="search">
|
||||||
<input type="text" class="md-search__input" name="query" required placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query">
|
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
|
||||||
<label class="md-icon md-search__icon" for="search"></label>
|
<label class="md-icon md-search__icon" for="__search"></label>
|
||||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset"></button>
|
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||||
|

|
||||||
|
</button>
|
||||||
</form>
|
</form>
|
||||||
<div class="md-search__output">
|
<div class="md-search__output">
|
||||||
<div class="md-search__scrollwrap" data-md-scrollfix>
|
<div class="md-search__scrollwrap" data-md-scrollfix>
|
||||||
@@ -135,7 +165,7 @@
|
|||||||
|
|
||||||
<div class="md-source__icon">
|
<div class="md-source__icon">
|
||||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||||
<use xlink:href="#github" width="24" height="24"></use>
|
<use xlink:href="#__github" width="24" height="24"></use>
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -164,7 +194,7 @@
|
|||||||
<div class="md-sidebar__scrollwrap">
|
<div class="md-sidebar__scrollwrap">
|
||||||
<div class="md-sidebar__inner">
|
<div class="md-sidebar__inner">
|
||||||
<nav class="md-nav md-nav--primary" data-md-level="0">
|
<nav class="md-nav md-nav--primary" data-md-level="0">
|
||||||
<label class="md-nav__title md-nav__title--site" for="drawer">
|
<label class="md-nav__title md-nav__title--site" for="__drawer">
|
||||||
<span class="md-nav__button md-logo">
|
<span class="md-nav__button md-logo">
|
||||||
|
|
||||||
<i class="md-icon"></i>
|
<i class="md-icon"></i>
|
||||||
@@ -184,7 +214,7 @@
|
|||||||
|
|
||||||
<div class="md-source__icon">
|
<div class="md-source__icon">
|
||||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||||
<use xlink:href="#github" width="24" height="24"></use>
|
<use xlink:href="#__github" width="24" height="24"></use>
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -218,10 +248,10 @@
|
|||||||
|
|
||||||
<li class="md-nav__item md-nav__item--active">
|
<li class="md-nav__item md-nav__item--active">
|
||||||
|
|
||||||
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="toc">
|
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc">
|
||||||
|
|
||||||
|
|
||||||
<label class="md-nav__link md-nav__link--active" for="toc">
|
<label class="md-nav__link md-nav__link--active" for="__toc">
|
||||||
Read
|
Read
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
@@ -234,7 +264,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<label class="md-nav__title" for="toc">Table of contents</label>
|
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||||
<ul class="md-nav__list" data-md-scrollfix>
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
<li class="md-nav__item">
|
<li class="md-nav__item">
|
||||||
@@ -256,6 +286,20 @@
|
|||||||
Splat
|
Splat
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#multiple-documents-specify-a-single-document" title="Multiple Documents - specify a single document" class="md-nav__link">
|
||||||
|
Multiple Documents - specify a single document
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#multiple-documents-read-all-documents" title="Multiple Documents - read all documents" class="md-nav__link">
|
||||||
|
Multiple Documents - read all documents
|
||||||
|
</a>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="md-nav__item">
|
<li class="md-nav__item">
|
||||||
@@ -281,6 +325,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</nav>
|
</nav>
|
||||||
@@ -363,7 +409,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<label class="md-nav__title" for="toc">Table of contents</label>
|
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||||
<ul class="md-nav__list" data-md-scrollfix>
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
<li class="md-nav__item">
|
<li class="md-nav__item">
|
||||||
@@ -385,6 +431,20 @@
|
|||||||
Splat
|
Splat
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#multiple-documents-specify-a-single-document" title="Multiple Documents - specify a single document" class="md-nav__link">
|
||||||
|
Multiple Documents - specify a single document
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#multiple-documents-read-all-documents" title="Multiple Documents - read all documents" class="md-nav__link">
|
||||||
|
Multiple Documents - read all documents
|
||||||
|
</a>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="md-nav__item">
|
<li class="md-nav__item">
|
||||||
@@ -410,6 +470,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</nav>
|
</nav>
|
||||||
@@ -467,6 +529,42 @@ bob:
|
|||||||
- apples
|
- apples
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
|
<h3 id="multiple-documents-specify-a-single-document">Multiple Documents - specify a single document<a class="headerlink" href="#multiple-documents-specify-a-single-document" title="Permanent link">¶</a></h3>
|
||||||
|
<p>Given a sample.yaml file of:</p>
|
||||||
|
<pre><code class="yaml">something: else
|
||||||
|
---
|
||||||
|
b:
|
||||||
|
c: 2
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>then</p>
|
||||||
|
<pre><code class="bash">yq r -d1 sample.yaml b.c
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>will output the value of '2'.</p>
|
||||||
|
<h3 id="multiple-documents-read-all-documents">Multiple Documents - read all documents<a class="headerlink" href="#multiple-documents-read-all-documents" title="Permanent link">¶</a></h3>
|
||||||
|
<p>Reading all documents will return the result as an array. This can be converted to json using the '-j' flag if desired.</p>
|
||||||
|
<p>Given a sample.yaml file of:</p>
|
||||||
|
<pre><code class="yaml">name: Fred
|
||||||
|
age: 22
|
||||||
|
---
|
||||||
|
name: Stella
|
||||||
|
age: 23
|
||||||
|
---
|
||||||
|
name: Android
|
||||||
|
age: 232
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>then</p>
|
||||||
|
<pre><code class="bash">yq r -d'*' sample.yaml name
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>will output:</p>
|
||||||
|
<pre><code>- Fred
|
||||||
|
- Stella
|
||||||
|
- Android
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
<h3 id="arrays">Arrays<a class="headerlink" href="#arrays" title="Permanent link">¶</a></h3>
|
<h3 id="arrays">Arrays<a class="headerlink" href="#arrays" title="Permanent link">¶</a></h3>
|
||||||
<p>You can give an index to access a specific element:
|
<p>You can give an index to access a specific element:
|
||||||
e.g.: given a sample file of</p>
|
e.g.: given a sample file of</p>
|
||||||
@@ -524,6 +622,8 @@ e.g.: given a sample file of</p>
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
@@ -573,7 +673,7 @@ e.g.: given a sample file of</p>
|
|||||||
<div class="md-footer-copyright">
|
<div class="md-footer-copyright">
|
||||||
|
|
||||||
powered by
|
powered by
|
||||||
<a href="http://www.mkdocs.org">MkDocs</a>
|
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||||
and
|
and
|
||||||
<a href="https://squidfunk.github.io/mkdocs-material/">
|
<a href="https://squidfunk.github.io/mkdocs-material/">
|
||||||
Material for MkDocs</a>
|
Material for MkDocs</a>
|
||||||
@@ -581,8 +681,7 @@ e.g.: given a sample file of</p>
|
|||||||
|
|
||||||
|
|
||||||
<div class="md-footer-social">
|
<div class="md-footer-social">
|
||||||
|
<link rel="stylesheet" href="../assets/fonts/font-awesome.css">
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
|
||||||
|
|
||||||
<a href="https://github.com/mikefarah" class="md-footer-social__link fa fa-github"></a>
|
<a href="https://github.com/mikefarah" class="md-footer-social__link fa fa-github"></a>
|
||||||
|
|
||||||
@@ -597,9 +696,9 @@ e.g.: given a sample file of</p>
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="../assets/javascripts/application.6cdc17f0.js"></script>
|
<script src="../assets/javascripts/application.a59e2a89.js"></script>
|
||||||
|
|
||||||
<script>app.initialize({version:"0.17.2",url:{base:".."}})</script>
|
<script>app.initialize({version:"0.17.5",url:{base:".."}})</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"docs": [
|
"docs": [
|
||||||
{
|
{
|
||||||
"location": "/",
|
"location": "/",
|
||||||
"text": "yq\n\u00b6\n\n\nyq is a lightweight and portable command-line YAML processor\n\n\nThe aim of the project is to be the \njq\n or sed of yaml files.\n\n\nInstall\n\u00b6\n\n\nOn MacOS:\n\n\nbrew install yq\n\n\n\n\nOn Ubuntu and other Linux distros supporting \nsnap\n packages:\n\n\nsnap install yq\n\n\n\n\nOn Ubuntu 16.04 or higher from Debian package:\n\n\nsudo add-apt-repository ppa:rmescandon/yq\nsudo apt update\nsudo apt install yq -y\n\n\n\n\nor, \nDownload latest binary\n or alternatively:\n\n\ngo get github.com/mikefarah/yq\n\n\n\n\nView on GitHub",
|
"text": "yq\n\u00b6\n\n\nyq is a lightweight and portable command-line YAML processor\n\n\nThe aim of the project is to be the \njq\n or sed of yaml files.\n\n\nInstall\n\u00b6\n\n\nOn MacOS:\n\n\nbrew install yq\n\n\n\n\nOn Ubuntu and other Linux distros supporting \nsnap\n packages:\n\n\nsnap install yq\n\n\n\n\nOn Ubuntu 16.04 or higher from Debian package:\n\n\nsudo add-apt-repository ppa:rmescandon/yq\nsudo apt update\nsudo apt install yq -y\n\n\n\n\nor, \nDownload latest binary\n or alternatively:\n\n\ngo get gopkg.in/mikefarah/yq.v2\n\n\n\n\nView on GitHub",
|
||||||
"title": "Install"
|
"title": "Install"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -12,12 +12,12 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"location": "/#install",
|
"location": "/#install",
|
||||||
"text": "On MacOS: brew install yq On Ubuntu and other Linux distros supporting snap packages: snap install yq On Ubuntu 16.04 or higher from Debian package: sudo add-apt-repository ppa:rmescandon/yq\nsudo apt update\nsudo apt install yq -y or, Download latest binary or alternatively: go get github.com/mikefarah/yq View on GitHub",
|
"text": "On MacOS: brew install yq On Ubuntu and other Linux distros supporting snap packages: snap install yq On Ubuntu 16.04 or higher from Debian package: sudo add-apt-repository ppa:rmescandon/yq\nsudo apt update\nsudo apt install yq -y or, Download latest binary or alternatively: go get gopkg.in/mikefarah/yq.v2 View on GitHub",
|
||||||
"title": "Install"
|
"title": "Install"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"location": "/read/",
|
"location": "/read/",
|
||||||
"text": "yq r <yaml_file|json_file> <path>\n\n\n\n\nThis command can take a json file as input too, and will output yaml unless specified to export as json (-j)\n\n\nBasic\n\u00b6\n\n\nGiven a sample.yaml file of:\n\n\nb:\n c: 2\n\n\n\n\nthen\n\n\nyq r sample.yaml b.c\n\n\n\n\nwill output the value of '2'.\n\n\nFrom Stdin\n\u00b6\n\n\nGiven a sample.yaml file of:\n\n\ncat sample.yaml | yq r - b.c\n\n\n\n\nwill output the value of '2'.\n\n\nSplat\n\u00b6\n\n\nGiven a sample.yaml file of:\n\n\n---\nbob:\n item1:\n cats: bananas\n item2:\n cats: apples\n\n\n\n\nthen\n\n\nyq r sample.yaml bob.*.cats\n\n\n\n\nwill output\n\n\n- bananas\n- apples\n\n\n\n\nArrays\n\u00b6\n\n\nYou can give an index to access a specific element:\ne.g.: given a sample file of\n\n\nb:\n e:\n - name: fred\n value: 3\n - name: sam\n value: 4\n\n\n\n\nthen\n\n\nyq r sample.yaml 'b.e[1].name'\n\n\n\n\nwill output 'sam'\n\n\nNote that the path is in quotes to avoid the square brackets being interpreted by your shell.\n\n\nArray Splat\n\u00b6\n\n\ne.g.: given a sample file of\n\n\nb:\n e:\n - name: fred\n value: 3\n - name: sam\n value: 4\n\n\n\n\nthen\n\n\nyq r sample.yaml 'b.e[*].name'\n\n\n\n\nwill output:\n\n\n- fred\n- sam\n\n\n\n\nNote that the path is in quotes to avoid the square brackets being interpreted by your shell.\n\n\nKeys with dots\n\u00b6\n\n\nWhen specifying a key that has a dot use key lookup indicator.\n\n\nb:\n foo.bar: 7\n\n\n\n\nyaml r sample.yaml 'b[foo.bar]'\n\n\n\n\nyaml w sample.yaml 'b[foo.bar]' 9\n\n\n\n\nAny valid yaml key can be specified as part of a key lookup.\n\n\nNote that the path is in quotes to avoid the square brackets being interpreted by your shell.",
|
"text": "yq r <yaml_file|json_file> <path>\n\n\n\n\nThis command can take a json file as input too, and will output yaml unless specified to export as json (-j)\n\n\nBasic\n\u00b6\n\n\nGiven a sample.yaml file of:\n\n\nb:\n c: 2\n\n\n\n\nthen\n\n\nyq r sample.yaml b.c\n\n\n\n\nwill output the value of '2'.\n\n\nFrom Stdin\n\u00b6\n\n\nGiven a sample.yaml file of:\n\n\ncat sample.yaml | yq r - b.c\n\n\n\n\nwill output the value of '2'.\n\n\nSplat\n\u00b6\n\n\nGiven a sample.yaml file of:\n\n\n---\nbob:\n item1:\n cats: bananas\n item2:\n cats: apples\n\n\n\n\nthen\n\n\nyq r sample.yaml bob.*.cats\n\n\n\n\nwill output\n\n\n- bananas\n- apples\n\n\n\n\nMultiple Documents - specify a single document\n\u00b6\n\n\nGiven a sample.yaml file of:\n\n\nsomething: else\n---\nb:\n c: 2\n\n\n\n\nthen\n\n\nyq r -d1 sample.yaml b.c\n\n\n\n\nwill output the value of '2'.\n\n\nMultiple Documents - read all documents\n\u00b6\n\n\nReading all documents will return the result as an array. This can be converted to json using the '-j' flag if desired.\n\n\nGiven a sample.yaml file of:\n\n\nname: Fred\nage: 22\n---\nname: Stella\nage: 23\n---\nname: Android\nage: 232\n\n\n\n\nthen\n\n\nyq r -d'*' sample.yaml name\n\n\n\n\nwill output:\n\n\n- Fred\n- Stella\n- Android\n\n\n\n\nArrays\n\u00b6\n\n\nYou can give an index to access a specific element:\ne.g.: given a sample file of\n\n\nb:\n e:\n - name: fred\n value: 3\n - name: sam\n value: 4\n\n\n\n\nthen\n\n\nyq r sample.yaml 'b.e[1].name'\n\n\n\n\nwill output 'sam'\n\n\nNote that the path is in quotes to avoid the square brackets being interpreted by your shell.\n\n\nArray Splat\n\u00b6\n\n\ne.g.: given a sample file of\n\n\nb:\n e:\n - name: fred\n value: 3\n - name: sam\n value: 4\n\n\n\n\nthen\n\n\nyq r sample.yaml 'b.e[*].name'\n\n\n\n\nwill output:\n\n\n- fred\n- sam\n\n\n\n\nNote that the path is in quotes to avoid the square brackets being interpreted by your shell.\n\n\nKeys with dots\n\u00b6\n\n\nWhen specifying a key that has a dot use key lookup indicator.\n\n\nb:\n foo.bar: 7\n\n\n\n\nyaml r sample.yaml 'b[foo.bar]'\n\n\n\n\nyaml w sample.yaml 'b[foo.bar]' 9\n\n\n\n\nAny valid yaml key can be specified as part of a key lookup.\n\n\nNote that the path is in quotes to avoid the square brackets being interpreted by your shell.",
|
||||||
"title": "Read"
|
"title": "Read"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -35,6 +35,16 @@
|
|||||||
"text": "Given a sample.yaml file of: ---\nbob:\n item1:\n cats: bananas\n item2:\n cats: apples then yq r sample.yaml bob.*.cats will output - bananas\n- apples",
|
"text": "Given a sample.yaml file of: ---\nbob:\n item1:\n cats: bananas\n item2:\n cats: apples then yq r sample.yaml bob.*.cats will output - bananas\n- apples",
|
||||||
"title": "Splat"
|
"title": "Splat"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"location": "/read/#multiple-documents-specify-a-single-document",
|
||||||
|
"text": "Given a sample.yaml file of: something: else\n---\nb:\n c: 2 then yq r -d1 sample.yaml b.c will output the value of '2'.",
|
||||||
|
"title": "Multiple Documents - specify a single document"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"location": "/read/#multiple-documents-read-all-documents",
|
||||||
|
"text": "Reading all documents will return the result as an array. This can be converted to json using the '-j' flag if desired. Given a sample.yaml file of: name: Fred\nage: 22\n---\nname: Stella\nage: 23\n---\nname: Android\nage: 232 then yq r -d'*' sample.yaml name will output: - Fred\n- Stella\n- Android",
|
||||||
|
"title": "Multiple Documents - read all documents"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"location": "/read/#arrays",
|
"location": "/read/#arrays",
|
||||||
"text": "You can give an index to access a specific element:\ne.g.: given a sample file of b:\n e:\n - name: fred\n value: 3\n - name: sam\n value: 4 then yq r sample.yaml 'b.e[1].name' will output 'sam' Note that the path is in quotes to avoid the square brackets being interpreted by your shell.",
|
"text": "You can give an index to access a specific element:\ne.g.: given a sample file of b:\n e:\n - name: fred\n value: 3\n - name: sam\n value: 4 then yq r sample.yaml 'b.e[1].name' will output 'sam' Note that the path is in quotes to avoid the square brackets being interpreted by your shell.",
|
||||||
@@ -52,7 +62,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"location": "/write/",
|
"location": "/write/",
|
||||||
"text": "yq w <yaml_file|json_file> <path> <new value>\n\n\n\n\nThis command can take a json file as input too, and will output yaml unless specified to export as json (-j)\n\n\nTo Stdout\n\u00b6\n\n\nGiven a sample.yaml file of:\n\n\nb:\n c: 2\n\n\n\n\nthen\n\n\nyq w sample.yaml b.c cat\n\n\n\n\nwill output:\n\n\nb:\n c: cat\n\n\n\n\nFrom STDIN\n\u00b6\n\n\ncat sample.yaml | yq w - b.c blah\n\n\n\n\nAdding new fields\n\u00b6\n\n\nAny missing fields in the path will be created on the fly.\n\n\nGiven a sample.yaml file of:\n\n\nb:\n c: 2\n\n\n\n\nthen\n\n\nyq w sample.yaml b.d[0] \"new thing\"\n\n\n\n\nwill output:\n\n\nb:\n c: cat\n d:\n - new thing\n\n\n\n\nAppending value to an array field\n\u00b6\n\n\nGiven a sample.yaml file of:\n\n\nb:\n c: 2\n d:\n - new thing\n - foo thing\n\n\n\n\nthen\n\n\nyq w sample.yaml \"b.d[+]\" \"bar thing\"\n\n\n\n\nwill output:\n\n\nb:\n c: cat\n d:\n - new thing\n - foo thing\n - bar thing\n\n\n\n\nNote that the path is in quotes to avoid the square brackets being interpreted by your shell.\n\n\nUpdating files in-place\n\u00b6\n\n\nGiven a sample.yaml file of:\n\n\nb:\n c: 2\n\n\n\n\nthen\n\n\nyq w -i sample.yaml b.c cat\n\n\n\n\nwill update the sample.yaml file so that the value of 'c' is cat.\n\n\nUpdating multiple values with a script\n\u00b6\n\n\nGiven a sample.yaml file of:\n\n\nb:\n c: 2\n e:\n - name: Billy Bob\n\n\n\n\nand a script update_instructions.yaml of:\n\n\nb.c: 3\nb.e[0].name: Howdy Partner\n\n\n\n\nthen\n\n\nyq w -s update_instructions.yaml sample.yaml\n\n\n\n\nwill output:\n\n\nb:\n c: 3\n e:\n - name: Howdy Partner\n\n\n\n\nAnd, of course, you can pipe the instructions in using '-':\n\n\ncat update_instructions.yaml | yq w -s - sample.yaml\n\n\n\n\nValues starting with a hyphen (or dash)\n\u00b6\n\n\nThe flag terminator needs to be used to stop the app from attempting to parse the subsequent arguments as flags:\n\n\nyq w -- my.path -3\n\n\n\n\nwill output\n\n\nmy:\n path: -3\n\n\n\n\nKeys with dots\n\u00b6\n\n\nWhen specifying a key that has a dot use key lookup indicator.\n\n\nb:\n foo.bar: 7\n\n\n\n\nyaml r sample.yaml 'b[foo.bar]'\n\n\n\n\nyaml w sample.yaml 'b[foo.bar]' 9\n\n\n\n\nAny valid yaml key can be specified as part of a key lookup.\n\n\nNote that the path is in quotes to avoid the square brackets being interpreted by your shell.",
|
"text": "yq w <yaml_file> <path> <new value>\n\n\n\n\nTo Stdout\n\u00b6\n\n\nGiven a sample.yaml file of:\n\n\nb:\n c: 2\n\n\n\n\nthen\n\n\nyq w sample.yaml b.c cat\n\n\n\n\nwill output:\n\n\nb:\n c: cat\n\n\n\n\nFrom STDIN\n\u00b6\n\n\ncat sample.yaml | yq w - b.c blah\n\n\n\n\nAdding new fields\n\u00b6\n\n\nAny missing fields in the path will be created on the fly.\n\n\nGiven a sample.yaml file of:\n\n\nb:\n c: 2\n\n\n\n\nthen\n\n\nyq w sample.yaml b.d[0] \"new thing\"\n\n\n\n\nwill output:\n\n\nb:\n c: cat\n d:\n - new thing\n\n\n\n\nAppending value to an array field\n\u00b6\n\n\nGiven a sample.yaml file of:\n\n\nb:\n c: 2\n d:\n - new thing\n - foo thing\n\n\n\n\nthen\n\n\nyq w sample.yaml \"b.d[+]\" \"bar thing\"\n\n\n\n\nwill output:\n\n\nb:\n c: cat\n d:\n - new thing\n - foo thing\n - bar thing\n\n\n\n\nNote that the path is in quotes to avoid the square brackets being interpreted by your shell.\n\n\nMultiple Documents - update a single document\n\u00b6\n\n\nGiven a sample.yaml file of:\n\n\nsomething: else\n---\nb:\n c: 2\n\n\n\n\nthen\n\n\nyq w -d1 sample.yaml b.c 5\n\n\n\n\nwill output:\n\n\nsomething: else\n---\nb:\n c: 5\n\n\n\n\nMultiple Documents - update all documents\n\u00b6\n\n\nGiven a sample.yaml file of:\n\n\nsomething: else\n---\nb:\n c: 2\n\n\n\n\nthen\n\n\nyq w -d'*' sample.yaml b.c 5\n\n\n\n\nwill output:\n\n\nsomething: else\nb:\n c: 5\n---\nb:\n c: 5\n\n\n\n\nNote that '*' is in quotes to avoid being interpreted by your shell.\n\n\nUpdating files in-place\n\u00b6\n\n\nGiven a sample.yaml file of:\n\n\nb:\n c: 2\n\n\n\n\nthen\n\n\nyq w -i sample.yaml b.c cat\n\n\n\n\nwill update the sample.yaml file so that the value of 'c' is cat.\n\n\nUpdating multiple values with a script\n\u00b6\n\n\nGiven a sample.yaml file of:\n\n\nb:\n c: 2\n e:\n - name: Billy Bob\n\n\n\n\nand a script update_instructions.yaml of:\n\n\nb.c: 3\nb.e[0].name: Howdy Partner\n\n\n\n\nthen\n\n\nyq w -s update_instructions.yaml sample.yaml\n\n\n\n\nwill output:\n\n\nb:\n c: 3\n e:\n - name: Howdy Partner\n\n\n\n\nAnd, of course, you can pipe the instructions in using '-':\n\n\ncat update_instructions.yaml | yq w -s - sample.yaml\n\n\n\n\nValues starting with a hyphen (or dash)\n\u00b6\n\n\nThe flag terminator needs to be used to stop the app from attempting to parse the subsequent arguments as flags:\n\n\nyq w -- my.path -3\n\n\n\n\nwill output\n\n\nmy:\n path: -3\n\n\n\n\nKeys with dots\n\u00b6\n\n\nWhen specifying a key that has a dot use key lookup indicator.\n\n\nb:\n foo.bar: 7\n\n\n\n\nyaml r sample.yaml 'b[foo.bar]'\n\n\n\n\nyaml w sample.yaml 'b[foo.bar]' 9\n\n\n\n\nAny valid yaml key can be specified as part of a key lookup.\n\n\nNote that the path is in quotes to avoid the square brackets being interpreted by your shell.",
|
||||||
"title": "Write/Update"
|
"title": "Write/Update"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -75,6 +85,16 @@
|
|||||||
"text": "Given a sample.yaml file of: b:\n c: 2\n d:\n - new thing\n - foo thing then yq w sample.yaml \"b.d[+]\" \"bar thing\" will output: b:\n c: cat\n d:\n - new thing\n - foo thing\n - bar thing Note that the path is in quotes to avoid the square brackets being interpreted by your shell.",
|
"text": "Given a sample.yaml file of: b:\n c: 2\n d:\n - new thing\n - foo thing then yq w sample.yaml \"b.d[+]\" \"bar thing\" will output: b:\n c: cat\n d:\n - new thing\n - foo thing\n - bar thing Note that the path is in quotes to avoid the square brackets being interpreted by your shell.",
|
||||||
"title": "Appending value to an array field"
|
"title": "Appending value to an array field"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"location": "/write/#multiple-documents-update-a-single-document",
|
||||||
|
"text": "Given a sample.yaml file of: something: else\n---\nb:\n c: 2 then yq w -d1 sample.yaml b.c 5 will output: something: else\n---\nb:\n c: 5",
|
||||||
|
"title": "Multiple Documents - update a single document"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"location": "/write/#multiple-documents-update-all-documents",
|
||||||
|
"text": "Given a sample.yaml file of: something: else\n---\nb:\n c: 2 then yq w -d'*' sample.yaml b.c 5 will output: something: else\nb:\n c: 5\n---\nb:\n c: 5 Note that '*' is in quotes to avoid being interpreted by your shell.",
|
||||||
|
"title": "Multiple Documents - update all documents"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"location": "/write/#updating-files-in-place",
|
"location": "/write/#updating-files-in-place",
|
||||||
"text": "Given a sample.yaml file of: b:\n c: 2 then yq w -i sample.yaml b.c cat will update the sample.yaml file so that the value of 'c' is cat.",
|
"text": "Given a sample.yaml file of: b:\n c: 2 then yq w -i sample.yaml b.c cat will update the sample.yaml file so that the value of 'c' is cat.",
|
||||||
@@ -97,7 +117,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"location": "/delete/",
|
"location": "/delete/",
|
||||||
"text": "yq d <yaml_file|json_file> <path_to_delete>\n\n\n\n\nThis command can take a json file as input too, and will output yaml unless specified to export as json (-j)\n\n\nTo Stdout\n\u00b6\n\n\nGiven a sample.yaml file of:\n\n\nb:\n c: 2\n apples: green\n\n\n\n\nthen\n\n\nyq d sample.yaml b.c\n\n\n\n\nwill output:\n\n\nb:\n apples: green\n\n\n\n\nFrom STDIN\n\u00b6\n\n\ncat sample.yaml | yq d - b.c\n\n\n\n\nDeleting array elements\n\u00b6\n\n\nGiven a sample.yaml file of:\n\n\nb:\n c: \n - 1\n - 2\n - 3\n\n\n\n\nthen\n\n\nyq d sample.yaml 'b.c[1]'\n\n\n\n\nwill output:\n\n\nb:\n c:\n - 1\n - 3\n\n\n\n\nDeleting nodes in-place\n\u00b6\n\n\nGiven a sample.yaml file of:\n\n\nb:\n c: 2\n apples: green\n\n\n\n\nthen\n\n\nyq d -i sample.yaml b.c\n\n\n\n\nwill update the sample.yaml file so that the 'c' node is deleted\n\n\nKeys with dots\n\u00b6\n\n\nWhen specifying a key that has a dot use key lookup indicator.\n\n\nb:\n foo.bar: 7\n\n\n\n\nyaml r sample.yaml 'b[foo.bar]'\n\n\n\n\nyaml w sample.yaml 'b[foo.bar]' 9\n\n\n\n\nAny valid yaml key can be specified as part of a key lookup.\n\n\nNote that the path is in quotes to avoid the square brackets being interpreted by your shell.",
|
"text": "yq d <yaml_file> <path_to_delete>\n\n\n\n\nTo Stdout\n\u00b6\n\n\nGiven a sample.yaml file of:\n\n\nb:\n c: 2\n apples: green\n\n\n\n\nthen\n\n\nyq d sample.yaml b.c\n\n\n\n\nwill output:\n\n\nb:\n apples: green\n\n\n\n\nFrom STDIN\n\u00b6\n\n\ncat sample.yaml | yq d - b.c\n\n\n\n\nDeleting array elements\n\u00b6\n\n\nGiven a sample.yaml file of:\n\n\nb:\n c: \n - 1\n - 2\n - 3\n\n\n\n\nthen\n\n\nyq d sample.yaml 'b.c[1]'\n\n\n\n\nwill output:\n\n\nb:\n c:\n - 1\n - 3\n\n\n\n\nDeleting nodes in-place\n\u00b6\n\n\nGiven a sample.yaml file of:\n\n\nb:\n c: 2\n apples: green\n\n\n\n\nthen\n\n\nyq d -i sample.yaml b.c\n\n\n\n\nwill update the sample.yaml file so that the 'c' node is deleted\n\n\nMultiple Documents - delete from single document\n\u00b6\n\n\nGiven a sample.yaml file of:\n\n\nsomething: else\nfield: leaveMe\n---\nb:\n c: 2\nfield: deleteMe\n\n\n\n\nthen\n\n\nyq w -d1 sample.yaml field\n\n\n\n\nwill output:\n\n\nsomething: else\nfield: leaveMe\n---\nb:\n c: 2\n\n\n\n\nMultiple Documents - delete from all documents\n\u00b6\n\n\nGiven a sample.yaml file of:\n\n\nsomething: else\nfield: deleteMe\n---\nb:\n c: 2\nfield: deleteMeToo\n\n\n\n\nthen\n\n\nyq w -d'*' sample.yaml field\n\n\n\n\nwill output:\n\n\nsomething: else\n---\nb:\n c: 2\n\n\n\n\nNote that '*' is in quotes to avoid being interpreted by your shell.\n\n\nKeys with dots\n\u00b6\n\n\nWhen specifying a key that has a dot use key lookup indicator.\n\n\nb:\n foo.bar: 7\n\n\n\n\nyaml r sample.yaml 'b[foo.bar]'\n\n\n\n\nyaml w sample.yaml 'b[foo.bar]' 9\n\n\n\n\nAny valid yaml key can be specified as part of a key lookup.\n\n\nNote that the path is in quotes to avoid the square brackets being interpreted by your shell.",
|
||||||
"title": "Delete"
|
"title": "Delete"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -120,6 +140,16 @@
|
|||||||
"text": "Given a sample.yaml file of: b:\n c: 2\n apples: green then yq d -i sample.yaml b.c will update the sample.yaml file so that the 'c' node is deleted",
|
"text": "Given a sample.yaml file of: b:\n c: 2\n apples: green then yq d -i sample.yaml b.c will update the sample.yaml file so that the 'c' node is deleted",
|
||||||
"title": "Deleting nodes in-place"
|
"title": "Deleting nodes in-place"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"location": "/delete/#multiple-documents-delete-from-single-document",
|
||||||
|
"text": "Given a sample.yaml file of: something: else\nfield: leaveMe\n---\nb:\n c: 2\nfield: deleteMe then yq w -d1 sample.yaml field will output: something: else\nfield: leaveMe\n---\nb:\n c: 2",
|
||||||
|
"title": "Multiple Documents - delete from single document"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"location": "/delete/#multiple-documents-delete-from-all-documents",
|
||||||
|
"text": "Given a sample.yaml file of: something: else\nfield: deleteMe\n---\nb:\n c: 2\nfield: deleteMeToo then yq w -d'*' sample.yaml field will output: something: else\n---\nb:\n c: 2 Note that '*' is in quotes to avoid being interpreted by your shell.",
|
||||||
|
"title": "Multiple Documents - delete from all documents"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"location": "/delete/#keys-with-dots",
|
"location": "/delete/#keys-with-dots",
|
||||||
"text": "When specifying a key that has a dot use key lookup indicator. b:\n foo.bar: 7 yaml r sample.yaml 'b[foo.bar]' yaml w sample.yaml 'b[foo.bar]' 9 Any valid yaml key can be specified as part of a key lookup. Note that the path is in quotes to avoid the square brackets being interpreted by your shell.",
|
"text": "When specifying a key that has a dot use key lookup indicator. b:\n foo.bar: 7 yaml r sample.yaml 'b[foo.bar]' yaml w sample.yaml 'b[foo.bar]' 9 Any valid yaml key can be specified as part of a key lookup. Note that the path is in quotes to avoid the square brackets being interpreted by your shell.",
|
||||||
@@ -127,7 +157,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"location": "/create/",
|
"location": "/create/",
|
||||||
"text": "Yaml files can be created using the 'new' command. This works in the same way as the write command, but you don't pass in an existing Yaml file.\n\n\nyq n <path> <new value>\n\n\n\n\nCreating a simple yaml file\n\u00b6\n\n\nyq n b.c cat\n\n\n\n\nwill output:\n\n\nb:\n c: cat\n\n\n\n\nCreating using a create script\n\u00b6\n\n\nCreate scripts follow the same format as the update scripts.\n\n\nGiven a script create_instructions.yaml of:\n\n\nb.c: 3\nb.e[0].name: Howdy Partner\n\n\n\n\nthen\n\n\nyq n -s create_instructions.yaml\n\n\n\n\nwill output:\n\n\nb:\n c: 3\n e:\n - name: Howdy Partner\n\n\n\n\nYou can also pipe the instructions in:\n\n\ncat create_instructions.yaml | yq n -s -\n\n\n\n\nKeys with dots\n\u00b6\n\n\nWhen specifying a key that has a dot use key lookup indicator.\n\n\nb:\n foo.bar: 7\n\n\n\n\nyaml r sample.yaml 'b[foo.bar]'\n\n\n\n\nyaml w sample.yaml 'b[foo.bar]' 9\n\n\n\n\nAny valid yaml key can be specified as part of a key lookup.\n\n\nNote that the path is in quotes to avoid the square brackets being interpreted by your shell.",
|
"text": "Yaml files can be created using the 'new' command. This works in the same way as the write command, but you don't pass in an existing Yaml file. Currently this does not support creating multiple documents in a single yaml file.\n\n\nyq n <path> <new value>\n\n\n\n\nCreating a simple yaml file\n\u00b6\n\n\nyq n b.c cat\n\n\n\n\nwill output:\n\n\nb:\n c: cat\n\n\n\n\nCreating using a create script\n\u00b6\n\n\nCreate scripts follow the same format as the update scripts.\n\n\nGiven a script create_instructions.yaml of:\n\n\nb.c: 3\nb.e[0].name: Howdy Partner\n\n\n\n\nthen\n\n\nyq n -s create_instructions.yaml\n\n\n\n\nwill output:\n\n\nb:\n c: 3\n e:\n - name: Howdy Partner\n\n\n\n\nYou can also pipe the instructions in:\n\n\ncat create_instructions.yaml | yq n -s -\n\n\n\n\nKeys with dots\n\u00b6\n\n\nWhen specifying a key that has a dot use key lookup indicator.\n\n\nb:\n foo.bar: 7\n\n\n\n\nyaml r sample.yaml 'b[foo.bar]'\n\n\n\n\nyaml w sample.yaml 'b[foo.bar]' 9\n\n\n\n\nAny valid yaml key can be specified as part of a key lookup.\n\n\nNote that the path is in quotes to avoid the square brackets being interpreted by your shell.",
|
||||||
"title": "Create"
|
"title": "Create"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -147,12 +177,12 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"location": "/convert/",
|
"location": "/convert/",
|
||||||
"text": "Yaml to Json\n\u00b6\n\n\nTo convert output to json, use the --tojson (or -j) flag. This can be used with any command.\n\n\nGiven a sample.yaml file of:\n\n\nb:\n c: 2\n\n\n\n\nthen\n\n\nyq r -j sample.yaml b.c\n\n\n\n\nwill output\n\n\n{\"b\":{\"c\":2}}\n\n\n\n\nJson to Yaml\n\u00b6\n\n\nTo read in json, just pass in a json file instead of yaml, it will just work :)\n\n\ne.g given a json file\n\n\n{\"a\":\"Easy! as one two three\",\"b\":{\"c\":2,\"d\":[3,4]}}\n\n\n\n\nthen\n\n\nyq r sample.json\n\n\n\n\nwill output\n\n\na: Easy! as one two three\nb:\n c: 2\n d:\n - 3\n - 4",
|
"text": "Yaml to Json\n\u00b6\n\n\nTo convert output to json, use the --tojson (or -j) flag. This can only be used with the read command.\n\n\nGiven a sample.yaml file of:\n\n\nb:\n c: 2\n\n\n\n\nthen\n\n\nyq r -j sample.yaml b.c\n\n\n\n\nwill output\n\n\n{\"b\":{\"c\":2}}\n\n\n\n\nJson to Yaml\n\u00b6\n\n\nTo read in json, just pass in a json file instead of yaml, it will just work :)\n\n\ne.g given a json file\n\n\n{\"a\":\"Easy! as one two three\",\"b\":{\"c\":2,\"d\":[3,4]}}\n\n\n\n\nthen\n\n\nyq r sample.json\n\n\n\n\nwill output\n\n\na: Easy! as one two three\nb:\n c: 2\n d:\n - 3\n - 4",
|
||||||
"title": "Convert"
|
"title": "Convert"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"location": "/convert/#yaml-to-json",
|
"location": "/convert/#yaml-to-json",
|
||||||
"text": "To convert output to json, use the --tojson (or -j) flag. This can be used with any command. Given a sample.yaml file of: b:\n c: 2 then yq r -j sample.yaml b.c will output {\"b\":{\"c\":2}}",
|
"text": "To convert output to json, use the --tojson (or -j) flag. This can only be used with the read command. Given a sample.yaml file of: b:\n c: 2 then yq r -j sample.yaml b.c will output {\"b\":{\"c\":2}}",
|
||||||
"title": "Yaml to Json"
|
"title": "Yaml to Json"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -162,7 +192,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"location": "/merge/",
|
"location": "/merge/",
|
||||||
"text": "Yaml files can be merged using the 'merge' command. Each additional file merged with the first file will\nset values for any key not existing already or where the key has no value.\n\n\nyq m <yaml_file|json_file> <path>...\n\n\n\n\nThis command can take a json file as input too, and will output yaml unless specified to export as json (-j)\n\n\nTo Stdout\n\u00b6\n\n\nGiven a data1.yaml file of:\n\n\na: simple\nb: [1, 2]\n\n\n\n\nand data2.yaml file of:\n\n\na: other\nc:\n test: 1\n\n\n\n\nthen\n\n\nyq m data1.yaml data2.yaml\n\n\n\n\nwill output:\n\n\na: simple\nb: [1, 2]\nc:\n test: 1\n\n\n\n\nUpdating files in-place\n\u00b6\n\n\nGiven a data1.yaml file of:\n\n\na: simple\nb: [1, 2]\n\n\n\n\nand data2.yaml file of:\n\n\na: other\nc:\n test: 1\n\n\n\n\nthen\n\n\nyq m -i data1.yaml data2.yaml\n\n\n\n\nwill update the data1.yaml file so that the value of 'c' is 'test: 1'.\n\n\nOverwrite values\n\u00b6\n\n\nGiven a data1.yaml file of:\n\n\na: simple\nb: [1, 2]\n\n\n\n\nand data2.yaml file of:\n\n\na: other\nc:\n test: 1\n\n\n\n\nthen\n\n\nyq m -x data1.yaml data2.yaml\n\n\n\n\nwill output:\n\n\na: other\nb: [1, 2]\nc:\n test: 1\n\n\n\n\nOverwrite values with arrays\n\u00b6\n\n\nGiven a data1.yaml file of:\n\n\na: simple\nb: [1, 2]\n\n\n\n\nand data3.yaml file of:\n\n\nb: [2, 3, 4]\nc:\n test: 2\n other: true\nd: false\n\n\n\n\nthen\n\n\nyq m -x data1.yaml data3.yaml\n\n\n\n\nwill output:\n\n\na: simple\nb: [2, 3, 4]\nc:\n test: 2\n other: true\nd: false\n\n\n\n\nNotice that 'b' does not result in the merging of the values within an array. The underlying library does not\ncurrently handle merging values within an array.",
|
"text": "Yaml files can be merged using the 'merge' command. Each additional file merged with the first file will\nset values for any key not existing already or where the key has no value.\n\n\nyq m <yaml_file> <path>...\n\n\n\n\nTo Stdout\n\u00b6\n\n\nGiven a data1.yaml file of:\n\n\na: simple\nb: [1, 2]\n\n\n\n\nand data2.yaml file of:\n\n\na: other\nc:\n test: 1\n\n\n\n\nthen\n\n\nyq m data1.yaml data2.yaml\n\n\n\n\nwill output:\n\n\na: simple\nb: [1, 2]\nc:\n test: 1\n\n\n\n\nUpdating files in-place\n\u00b6\n\n\nGiven a data1.yaml file of:\n\n\na: simple\nb: [1, 2]\n\n\n\n\nand data2.yaml file of:\n\n\na: other\nc:\n test: 1\n\n\n\n\nthen\n\n\nyq m -i data1.yaml data2.yaml\n\n\n\n\nwill update the data1.yaml file so that the value of 'c' is 'test: 1'.\n\n\nOverwrite values\n\u00b6\n\n\nGiven a data1.yaml file of:\n\n\na: simple\nb: [1, 2]\n\n\n\n\nand data2.yaml file of:\n\n\na: other\nc:\n test: 1\n\n\n\n\nthen\n\n\nyq m -x data1.yaml data2.yaml\n\n\n\n\nwill output:\n\n\na: other\nb: [1, 2]\nc:\n test: 1\n\n\n\n\nOverwrite values with arrays\n\u00b6\n\n\nGiven a data1.yaml file of:\n\n\na: simple\nb: [1, 2]\n\n\n\n\nand data3.yaml file of:\n\n\nb: [3, 4]\nc:\n test: 2\n other: true\nd: false\n\n\n\n\nthen\n\n\nyq m -x data1.yaml data3.yaml\n\n\n\n\nwill output:\n\n\na: simple\nb: [3, 4]\nc:\n test: 2\n other: true\nd: false\n\n\n\n\nNotice that 'b' does not result in the merging of the values within an array. \n\n\nAppend values with arrays\n\u00b6\n\n\nGiven a data1.yaml file of:\n\n\na: simple\nb: [1, 2]\nd: hi\n\n\n\n\nand data3.yaml file of:\n\n\na: something\nb: [3, 4]\nc:\n test: 2\n other: true\n\n\n\n\nthen\n\n\nyq m -a data1.yaml data3.yaml\n\n\n\n\nwill output:\n\n\na: simple\nb: [1, 2, 3, 4]\nc:\n test: 2\n other: true\nd: hi\n\n\n\n\nNote that the 'b' array has concatenated the values from the second data file. Also note that other map keys are not overridden (field a).\n\n\nAppend cannot be used with overwrite, if both flags are given then append is ignored.\n\n\nMultiple Documents - merge into single document\n\u00b6\n\n\nCurrently yq only has multi-document support for the \nfirst\n document being merged into. The remaining yaml files will have their first document selected.\n\n\nGiven a data1.yaml file of:\n\n\nsomething: else\n---\na: simple\nb: cat\n\n\n\n\nand data3.yaml file of:\n\n\nb: dog\n\n\n\n\nthen\n\n\nyq m -x -d1 data1.yaml data3.yaml\n\n\n\n\nwill output:\n\n\nsomething: else\n---\na: simple\nb: dog\n\n\n\n\nMultiple Documents - merge into all documents\n\u00b6\n\n\nCurrently yq only has multi-document support for the \nfirst\n document being merged into. The remaining yaml files will have their first document selected.\n\n\nGiven a data1.yaml file of:\n\n\nsomething: else\n---\na: simple\nb: cat\n\n\n\n\nand data3.yaml file of:\n\n\nb: dog\n\n\n\n\nthen\n\n\nyq m -x -d'*' data1.yaml data3.yaml\n\n\n\n\nwill output:\n\n\nb: dog\nsomething: else\n---\na: simple\nb: dog",
|
||||||
"title": "Merge"
|
"title": "Merge"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -182,8 +212,23 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"location": "/merge/#overwrite-values-with-arrays",
|
"location": "/merge/#overwrite-values-with-arrays",
|
||||||
"text": "Given a data1.yaml file of: a: simple\nb: [1, 2] and data3.yaml file of: b: [2, 3, 4]\nc:\n test: 2\n other: true\nd: false then yq m -x data1.yaml data3.yaml will output: a: simple\nb: [2, 3, 4]\nc:\n test: 2\n other: true\nd: false Notice that 'b' does not result in the merging of the values within an array. The underlying library does not\ncurrently handle merging values within an array.",
|
"text": "Given a data1.yaml file of: a: simple\nb: [1, 2] and data3.yaml file of: b: [3, 4]\nc:\n test: 2\n other: true\nd: false then yq m -x data1.yaml data3.yaml will output: a: simple\nb: [3, 4]\nc:\n test: 2\n other: true\nd: false Notice that 'b' does not result in the merging of the values within an array.",
|
||||||
"title": "Overwrite values with arrays"
|
"title": "Overwrite values with arrays"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"location": "/merge/#append-values-with-arrays",
|
||||||
|
"text": "Given a data1.yaml file of: a: simple\nb: [1, 2]\nd: hi and data3.yaml file of: a: something\nb: [3, 4]\nc:\n test: 2\n other: true then yq m -a data1.yaml data3.yaml will output: a: simple\nb: [1, 2, 3, 4]\nc:\n test: 2\n other: true\nd: hi Note that the 'b' array has concatenated the values from the second data file. Also note that other map keys are not overridden (field a). Append cannot be used with overwrite, if both flags are given then append is ignored.",
|
||||||
|
"title": "Append values with arrays"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"location": "/merge/#multiple-documents-merge-into-single-document",
|
||||||
|
"text": "Currently yq only has multi-document support for the first document being merged into. The remaining yaml files will have their first document selected. Given a data1.yaml file of: something: else\n---\na: simple\nb: cat and data3.yaml file of: b: dog then yq m -x -d1 data1.yaml data3.yaml will output: something: else\n---\na: simple\nb: dog",
|
||||||
|
"title": "Multiple Documents - merge into single document"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"location": "/merge/#multiple-documents-merge-into-all-documents",
|
||||||
|
"text": "Currently yq only has multi-document support for the first document being merged into. The remaining yaml files will have their first document selected. Given a data1.yaml file of: something: else\n---\na: simple\nb: cat and data3.yaml file of: b: dog then yq m -x -d'*' data1.yaml data3.yaml will output: b: dog\nsomething: else\n---\na: simple\nb: dog",
|
||||||
|
"title": "Multiple Documents - merge into all documents"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -1,60 +1,38 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||||
|
|
||||||
|
|
||||||
<url>
|
<url>
|
||||||
<loc>/</loc>
|
<loc>/</loc>
|
||||||
<lastmod>2018-06-12</lastmod>
|
<lastmod>2018-07-10</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<url>
|
<url>
|
||||||
<loc>/read/</loc>
|
<loc>/read/</loc>
|
||||||
<lastmod>2018-06-12</lastmod>
|
<lastmod>2018-07-10</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<url>
|
<url>
|
||||||
<loc>/write/</loc>
|
<loc>/write/</loc>
|
||||||
<lastmod>2018-06-12</lastmod>
|
<lastmod>2018-07-10</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<url>
|
<url>
|
||||||
<loc>/delete/</loc>
|
<loc>/delete/</loc>
|
||||||
<lastmod>2018-06-12</lastmod>
|
<lastmod>2018-07-10</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<url>
|
<url>
|
||||||
<loc>/create/</loc>
|
<loc>/create/</loc>
|
||||||
<lastmod>2018-06-12</lastmod>
|
<lastmod>2018-07-10</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<url>
|
<url>
|
||||||
<loc>/convert/</loc>
|
<loc>/convert/</loc>
|
||||||
<lastmod>2018-06-12</lastmod>
|
<lastmod>2018-07-10</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<url>
|
<url>
|
||||||
<loc>/merge/</loc>
|
<loc>/merge/</loc>
|
||||||
<lastmod>2018-06-12</lastmod>
|
<lastmod>2018-07-10</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
|
|
||||||
|
|
||||||
</urlset>
|
</urlset>
|
||||||
@@ -19,6 +19,10 @@
|
|||||||
|
|
||||||
<meta name="lang:search.language" content="en">
|
<meta name="lang:search.language" content="en">
|
||||||
|
|
||||||
|
<meta name="lang:search.pipeline.stopwords" content="True">
|
||||||
|
|
||||||
|
<meta name="lang:search.pipeline.trimmer" content="True">
|
||||||
|
|
||||||
<meta name="lang:search.result.none" content="No matching documents">
|
<meta name="lang:search.result.none" content="No matching documents">
|
||||||
|
|
||||||
<meta name="lang:search.result.one" content="1 matching document">
|
<meta name="lang:search.result.one" content="1 matching document">
|
||||||
@@ -28,7 +32,7 @@
|
|||||||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||||
|
|
||||||
<link rel="shortcut icon" href="../assets/images/favicon.png">
|
<link rel="shortcut icon" href="../assets/images/favicon.png">
|
||||||
<meta name="generator" content="mkdocs-0.17.2, mkdocs-material-2.2.5">
|
<meta name="generator" content="mkdocs-0.17.5, mkdocs-material-2.9.2">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -36,36 +40,60 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../assets/stylesheets/application.bcabdff3.css">
|
<link rel="stylesheet" href="../assets/stylesheets/application.ba0fd1a6.css">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script src="../assets/javascripts/modernizr.1aa3b519.js"></script>
|
<script src="../assets/javascripts/modernizr.1aa3b519.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
|
||||||
|
|
||||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
|
||||||
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
|
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
|
||||||
|
|
||||||
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
|
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="../assets/fonts/material-icons.css">
|
||||||
|
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body dir="ltr">
|
||||||
|
|
||||||
<svg class="md-svg">
|
<svg class="md-svg">
|
||||||
<defs>
|
<defs>
|
||||||
|
|
||||||
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448" viewBox="0 0 416 448" id="github"><path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19T128 352t-18.125-8.5-10.75-19T96 304t3.125-20.5 10.75-19T128 256t18.125 8.5 10.75 19T160 304zm160 0q0 10-3.125 20.5t-10.75 19T288 352t-18.125-8.5-10.75-19T256 304t3.125-20.5 10.75-19T288 256t18.125 8.5 10.75 19T320 304zm40 0q0-30-17.25-51T296 232q-10.25 0-48.75 5.25Q229.5 240 208 240t-39.25-2.75Q130.75 232 120 232q-29.5 0-46.75 21T56 304q0 22 8 38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0 37.25-1.75t35-7.375 30.5-15 20.25-25.75T360 304zm56-44q0 51.75-15.25 82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5T212 416q-19.5 0-35.5-.75t-36.875-3.125-38.125-7.5-34.25-12.875T37 371.5t-21.5-28.75Q0 312 0 260q0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25 30.875Q171.5 96 212 96q37 0 70 8 26.25-20.5 46.75-30.25T376 64q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34 99.5z"/></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448"
|
||||||
|
viewBox="0 0 416 448" id="__github">
|
||||||
|
<path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19-18.125
|
||||||
|
8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19 18.125-8.5
|
||||||
|
18.125 8.5 10.75 19 3.125 20.5zM320 304q0 10-3.125 20.5t-10.75
|
||||||
|
19-18.125 8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19
|
||||||
|
18.125-8.5 18.125 8.5 10.75 19 3.125 20.5zM360
|
||||||
|
304q0-30-17.25-51t-46.75-21q-10.25 0-48.75 5.25-17.75 2.75-39.25
|
||||||
|
2.75t-39.25-2.75q-38-5.25-48.75-5.25-29.5 0-46.75 21t-17.25 51q0 22 8
|
||||||
|
38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0
|
||||||
|
37.25-1.75t35-7.375 30.5-15 20.25-25.75 8-38.375zM416 260q0 51.75-15.25
|
||||||
|
82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5-41.75
|
||||||
|
1.125q-19.5 0-35.5-0.75t-36.875-3.125-38.125-7.5-34.25-12.875-30.25-20.25-21.5-28.75q-15.5-30.75-15.5-82.75
|
||||||
|
0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25
|
||||||
|
30.875q36.75-8.75 77.25-8.75 37 0 70 8 26.25-20.5
|
||||||
|
46.75-30.25t47.25-9.75q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34
|
||||||
|
99.5z" />
|
||||||
|
</svg>
|
||||||
|
|
||||||
</defs>
|
</defs>
|
||||||
</svg>
|
</svg>
|
||||||
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="drawer">
|
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
|
||||||
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="search">
|
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
|
||||||
<label class="md-overlay" data-md-component="overlay" for="drawer"></label>
|
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
|
||||||
|
|
||||||
|
<a href="#to-stdout" tabindex="1" class="md-skip">
|
||||||
|
Skip to content
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
<header class="md-header" data-md-component="header">
|
<header class="md-header" data-md-component="header">
|
||||||
<nav class="md-header-nav md-grid">
|
<nav class="md-header-nav md-grid">
|
||||||
@@ -78,7 +106,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="md-flex__cell md-flex__cell--shrink">
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
<label class="md-icon md-icon--menu md-header-nav__button" for="drawer"></label>
|
<label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
|
||||||
</div>
|
</div>
|
||||||
<div class="md-flex__cell md-flex__cell--stretch">
|
<div class="md-flex__cell md-flex__cell--stretch">
|
||||||
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
||||||
@@ -97,15 +125,17 @@
|
|||||||
<div class="md-flex__cell md-flex__cell--shrink">
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
|
||||||
|
|
||||||
<label class="md-icon md-icon--search md-header-nav__button" for="search"></label>
|
<label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
|
||||||
|
|
||||||
<div class="md-search" data-md-component="search" role="dialog">
|
<div class="md-search" data-md-component="search" role="dialog">
|
||||||
<label class="md-search__overlay" for="search"></label>
|
<label class="md-search__overlay" for="__search"></label>
|
||||||
<div class="md-search__inner">
|
<div class="md-search__inner" role="search">
|
||||||
<form class="md-search__form" name="search">
|
<form class="md-search__form" name="search">
|
||||||
<input type="text" class="md-search__input" name="query" required placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query">
|
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
|
||||||
<label class="md-icon md-search__icon" for="search"></label>
|
<label class="md-icon md-search__icon" for="__search"></label>
|
||||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset"></button>
|
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||||
|

|
||||||
|
</button>
|
||||||
</form>
|
</form>
|
||||||
<div class="md-search__output">
|
<div class="md-search__output">
|
||||||
<div class="md-search__scrollwrap" data-md-scrollfix>
|
<div class="md-search__scrollwrap" data-md-scrollfix>
|
||||||
@@ -135,7 +165,7 @@
|
|||||||
|
|
||||||
<div class="md-source__icon">
|
<div class="md-source__icon">
|
||||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||||
<use xlink:href="#github" width="24" height="24"></use>
|
<use xlink:href="#__github" width="24" height="24"></use>
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -164,7 +194,7 @@
|
|||||||
<div class="md-sidebar__scrollwrap">
|
<div class="md-sidebar__scrollwrap">
|
||||||
<div class="md-sidebar__inner">
|
<div class="md-sidebar__inner">
|
||||||
<nav class="md-nav md-nav--primary" data-md-level="0">
|
<nav class="md-nav md-nav--primary" data-md-level="0">
|
||||||
<label class="md-nav__title md-nav__title--site" for="drawer">
|
<label class="md-nav__title md-nav__title--site" for="__drawer">
|
||||||
<span class="md-nav__button md-logo">
|
<span class="md-nav__button md-logo">
|
||||||
|
|
||||||
<i class="md-icon"></i>
|
<i class="md-icon"></i>
|
||||||
@@ -184,7 +214,7 @@
|
|||||||
|
|
||||||
<div class="md-source__icon">
|
<div class="md-source__icon">
|
||||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||||
<use xlink:href="#github" width="24" height="24"></use>
|
<use xlink:href="#__github" width="24" height="24"></use>
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -230,10 +260,10 @@
|
|||||||
|
|
||||||
<li class="md-nav__item md-nav__item--active">
|
<li class="md-nav__item md-nav__item--active">
|
||||||
|
|
||||||
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="toc">
|
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc">
|
||||||
|
|
||||||
|
|
||||||
<label class="md-nav__link md-nav__link--active" for="toc">
|
<label class="md-nav__link md-nav__link--active" for="__toc">
|
||||||
Write/Update
|
Write/Update
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
@@ -246,7 +276,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<label class="md-nav__title" for="toc">Table of contents</label>
|
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||||
<ul class="md-nav__list" data-md-scrollfix>
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
<li class="md-nav__item">
|
<li class="md-nav__item">
|
||||||
@@ -275,6 +305,20 @@
|
|||||||
Appending value to an array field
|
Appending value to an array field
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#multiple-documents-update-a-single-document" title="Multiple Documents - update a single document" class="md-nav__link">
|
||||||
|
Multiple Documents - update a single document
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#multiple-documents-update-all-documents" title="Multiple Documents - update all documents" class="md-nav__link">
|
||||||
|
Multiple Documents - update all documents
|
||||||
|
</a>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="md-nav__item">
|
<li class="md-nav__item">
|
||||||
@@ -307,6 +351,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</nav>
|
</nav>
|
||||||
@@ -377,7 +423,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<label class="md-nav__title" for="toc">Table of contents</label>
|
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||||
<ul class="md-nav__list" data-md-scrollfix>
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
<li class="md-nav__item">
|
<li class="md-nav__item">
|
||||||
@@ -406,6 +452,20 @@
|
|||||||
Appending value to an array field
|
Appending value to an array field
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#multiple-documents-update-a-single-document" title="Multiple Documents - update a single document" class="md-nav__link">
|
||||||
|
Multiple Documents - update a single document
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#multiple-documents-update-all-documents" title="Multiple Documents - update all documents" class="md-nav__link">
|
||||||
|
Multiple Documents - update all documents
|
||||||
|
</a>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="md-nav__item">
|
<li class="md-nav__item">
|
||||||
@@ -438,6 +498,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</nav>
|
</nav>
|
||||||
@@ -455,10 +517,9 @@
|
|||||||
|
|
||||||
<h1>Write/Update</h1>
|
<h1>Write/Update</h1>
|
||||||
|
|
||||||
<pre><code>yq w <yaml_file|json_file> <path> <new value>
|
<pre><code>yq w <yaml_file> <path> <new value>
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>This command can take a json file as input too, and will output yaml unless specified to export as json (-j)</p>
|
|
||||||
<h3 id="to-stdout">To Stdout<a class="headerlink" href="#to-stdout" title="Permanent link">¶</a></h3>
|
<h3 id="to-stdout">To Stdout<a class="headerlink" href="#to-stdout" title="Permanent link">¶</a></h3>
|
||||||
<p>Given a sample.yaml file of:</p>
|
<p>Given a sample.yaml file of:</p>
|
||||||
<pre><code class="yaml">b:
|
<pre><code class="yaml">b:
|
||||||
@@ -519,6 +580,47 @@
|
|||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>Note that the path is in quotes to avoid the square brackets being interpreted by your shell.</p>
|
<p>Note that the path is in quotes to avoid the square brackets being interpreted by your shell.</p>
|
||||||
|
<h3 id="multiple-documents-update-a-single-document">Multiple Documents - update a single document<a class="headerlink" href="#multiple-documents-update-a-single-document" title="Permanent link">¶</a></h3>
|
||||||
|
<p>Given a sample.yaml file of:</p>
|
||||||
|
<pre><code class="yaml">something: else
|
||||||
|
---
|
||||||
|
b:
|
||||||
|
c: 2
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>then</p>
|
||||||
|
<pre><code class="bash">yq w -d1 sample.yaml b.c 5
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>will output:</p>
|
||||||
|
<pre><code class="yaml">something: else
|
||||||
|
---
|
||||||
|
b:
|
||||||
|
c: 5
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<h3 id="multiple-documents-update-all-documents">Multiple Documents - update all documents<a class="headerlink" href="#multiple-documents-update-all-documents" title="Permanent link">¶</a></h3>
|
||||||
|
<p>Given a sample.yaml file of:</p>
|
||||||
|
<pre><code class="yaml">something: else
|
||||||
|
---
|
||||||
|
b:
|
||||||
|
c: 2
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>then</p>
|
||||||
|
<pre><code class="bash">yq w -d'*' sample.yaml b.c 5
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>will output:</p>
|
||||||
|
<pre><code class="yaml">something: else
|
||||||
|
b:
|
||||||
|
c: 5
|
||||||
|
---
|
||||||
|
b:
|
||||||
|
c: 5
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>Note that '*' is in quotes to avoid being interpreted by your shell.</p>
|
||||||
<h3 id="updating-files-in-place">Updating files in-place<a class="headerlink" href="#updating-files-in-place" title="Permanent link">¶</a></h3>
|
<h3 id="updating-files-in-place">Updating files in-place<a class="headerlink" href="#updating-files-in-place" title="Permanent link">¶</a></h3>
|
||||||
<p>Given a sample.yaml file of:</p>
|
<p>Given a sample.yaml file of:</p>
|
||||||
<pre><code class="yaml">b:
|
<pre><code class="yaml">b:
|
||||||
@@ -588,6 +690,8 @@ b.e[0].name: Howdy Partner
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
@@ -637,7 +741,7 @@ b.e[0].name: Howdy Partner
|
|||||||
<div class="md-footer-copyright">
|
<div class="md-footer-copyright">
|
||||||
|
|
||||||
powered by
|
powered by
|
||||||
<a href="http://www.mkdocs.org">MkDocs</a>
|
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||||
and
|
and
|
||||||
<a href="https://squidfunk.github.io/mkdocs-material/">
|
<a href="https://squidfunk.github.io/mkdocs-material/">
|
||||||
Material for MkDocs</a>
|
Material for MkDocs</a>
|
||||||
@@ -645,8 +749,7 @@ b.e[0].name: Howdy Partner
|
|||||||
|
|
||||||
|
|
||||||
<div class="md-footer-social">
|
<div class="md-footer-social">
|
||||||
|
<link rel="stylesheet" href="../assets/fonts/font-awesome.css">
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
|
||||||
|
|
||||||
<a href="https://github.com/mikefarah" class="md-footer-social__link fa fa-github"></a>
|
<a href="https://github.com/mikefarah" class="md-footer-social__link fa fa-github"></a>
|
||||||
|
|
||||||
@@ -661,9 +764,9 @@ b.e[0].name: Howdy Partner
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="../assets/javascripts/application.6cdc17f0.js"></script>
|
<script src="../assets/javascripts/application.a59e2a89.js"></script>
|
||||||
|
|
||||||
<script>app.initialize({version:"0.17.2",url:{base:".."}})</script>
|
<script>app.initialize({version:"0.17.5",url:{base:".."}})</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
a: other
|
a: other
|
||||||
|
b: [3, 4]
|
||||||
c:
|
c:
|
||||||
test: 1
|
test: 1
|
||||||
|
|||||||
@@ -1,5 +1 @@
|
|||||||
b: [2, 3, 4]
|
b: dog
|
||||||
c:
|
|
||||||
test: 2
|
|
||||||
other: true
|
|
||||||
d: false
|
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
commonKey: first document
|
||||||
a: Easy! as one two three
|
a: Easy! as one two three
|
||||||
b:
|
b:
|
||||||
c: 2
|
c: 2
|
||||||
@@ -8,8 +9,10 @@ b:
|
|||||||
- name: sam
|
- name: sam
|
||||||
value: 4
|
value: 4
|
||||||
---
|
---
|
||||||
|
commonKey: second document
|
||||||
another:
|
another:
|
||||||
document: here
|
document: here
|
||||||
---
|
---
|
||||||
|
commonKey: third document
|
||||||
wow:
|
wow:
|
||||||
- here is another
|
- here is another
|
||||||
|
|||||||
1
examples/sample_array_2.yaml
Normal file
1
examples/sample_array_2.yaml
Normal file
@@ -0,0 +1 @@
|
|||||||
|
[4,5]
|
||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
yaml "gopkg.in/yaml.v2"
|
yaml "gopkg.in/mikefarah/yaml.v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func jsonToString(context interface{}) (string, error) {
|
func jsonToString(context interface{}) (string, error) {
|
||||||
|
|||||||
10
merge.go
10
merge.go
@@ -1,12 +1,12 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import "gopkg.in/imdario/mergo.v0"
|
||||||
"github.com/imdario/mergo"
|
|
||||||
)
|
|
||||||
|
|
||||||
func merge(dst, src interface{}, overwrite bool) error {
|
func merge(dst interface{}, src interface{}, overwrite bool, append bool) error {
|
||||||
if overwrite {
|
if overwrite {
|
||||||
return mergo.MergeWithOverwrite(dst, src)
|
return mergo.Merge(dst, src, mergo.WithOverride)
|
||||||
|
} else if append {
|
||||||
|
return mergo.Merge(dst, src, mergo.WithAppendSlice)
|
||||||
}
|
}
|
||||||
return mergo.Merge(dst, src)
|
return mergo.Merge(dst, src)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
### Yaml to Json
|
### Yaml to Json
|
||||||
To convert output to json, use the --tojson (or -j) flag. This can be used with any command.
|
To convert output to json, use the --tojson (or -j) flag. This can only be used with the read command.
|
||||||
|
|
||||||
Given a sample.yaml file of:
|
Given a sample.yaml file of:
|
||||||
```yaml
|
```yaml
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
Yaml files can be created using the 'new' command. This works in the same way as the write command, but you don't pass in an existing Yaml file.
|
Yaml files can be created using the 'new' command. This works in the same way as the write command, but you don't pass in an existing Yaml file. Currently this does not support creating multiple documents in a single yaml file.
|
||||||
|
|
||||||
```
|
```
|
||||||
yq n <path> <new value>
|
yq n <path> <new value>
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
```
|
```
|
||||||
yq d <yaml_file|json_file> <path_to_delete>
|
yq d <yaml_file> <path_to_delete>
|
||||||
```
|
```
|
||||||
{!snippets/works_with_json.md!}
|
|
||||||
|
|
||||||
### To Stdout
|
### To Stdout
|
||||||
Given a sample.yaml file of:
|
Given a sample.yaml file of:
|
||||||
@@ -60,4 +59,52 @@ yq d -i sample.yaml b.c
|
|||||||
will update the sample.yaml file so that the 'c' node is deleted
|
will update the sample.yaml file so that the 'c' node is deleted
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Multiple Documents - delete from single document
|
||||||
|
Given a sample.yaml file of:
|
||||||
|
```yaml
|
||||||
|
something: else
|
||||||
|
field: leaveMe
|
||||||
|
---
|
||||||
|
b:
|
||||||
|
c: 2
|
||||||
|
field: deleteMe
|
||||||
|
```
|
||||||
|
then
|
||||||
|
```bash
|
||||||
|
yq w -d1 sample.yaml field
|
||||||
|
```
|
||||||
|
will output:
|
||||||
|
```yaml
|
||||||
|
something: else
|
||||||
|
field: leaveMe
|
||||||
|
---
|
||||||
|
b:
|
||||||
|
c: 2
|
||||||
|
```
|
||||||
|
|
||||||
|
### Multiple Documents - delete from all documents
|
||||||
|
Given a sample.yaml file of:
|
||||||
|
```yaml
|
||||||
|
something: else
|
||||||
|
field: deleteMe
|
||||||
|
---
|
||||||
|
b:
|
||||||
|
c: 2
|
||||||
|
field: deleteMeToo
|
||||||
|
```
|
||||||
|
then
|
||||||
|
```bash
|
||||||
|
yq w -d'*' sample.yaml field
|
||||||
|
```
|
||||||
|
will output:
|
||||||
|
```yaml
|
||||||
|
something: else
|
||||||
|
---
|
||||||
|
b:
|
||||||
|
c: 2
|
||||||
|
```
|
||||||
|
|
||||||
|
Note that '*' is in quotes to avoid being interpreted by your shell.
|
||||||
|
|
||||||
{!snippets/keys_with_dots.md!}
|
{!snippets/keys_with_dots.md!}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ sudo apt install yq -y
|
|||||||
```
|
```
|
||||||
or, [Download latest binary](https://github.com/mikefarah/yq/releases/latest) or alternatively:
|
or, [Download latest binary](https://github.com/mikefarah/yq/releases/latest) or alternatively:
|
||||||
```
|
```
|
||||||
go get github.com/mikefarah/yq
|
go get gopkg.in/mikefarah/yq.v2
|
||||||
```
|
```
|
||||||
|
|
||||||
[View on GitHub](https://github.com/mikefarah/yq)
|
[View on GitHub](https://github.com/mikefarah/yq)
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ Yaml files can be merged using the 'merge' command. Each additional file merged
|
|||||||
set values for any key not existing already or where the key has no value.
|
set values for any key not existing already or where the key has no value.
|
||||||
|
|
||||||
```
|
```
|
||||||
yq m <yaml_file|json_file> <path>...
|
yq m <yaml_file> <path>...
|
||||||
```
|
```
|
||||||
{!snippets/works_with_json.md!}
|
|
||||||
|
|
||||||
### To Stdout
|
### To Stdout
|
||||||
Given a data1.yaml file of:
|
Given a data1.yaml file of:
|
||||||
@@ -80,7 +80,7 @@ b: [1, 2]
|
|||||||
```
|
```
|
||||||
and data3.yaml file of:
|
and data3.yaml file of:
|
||||||
```yaml
|
```yaml
|
||||||
b: [2, 3, 4]
|
b: [3, 4]
|
||||||
c:
|
c:
|
||||||
test: 2
|
test: 2
|
||||||
other: true
|
other: true
|
||||||
@@ -93,12 +93,97 @@ yq m -x data1.yaml data3.yaml
|
|||||||
will output:
|
will output:
|
||||||
```yaml
|
```yaml
|
||||||
a: simple
|
a: simple
|
||||||
b: [2, 3, 4]
|
b: [3, 4]
|
||||||
c:
|
c:
|
||||||
test: 2
|
test: 2
|
||||||
other: true
|
other: true
|
||||||
d: false
|
d: false
|
||||||
```
|
```
|
||||||
|
|
||||||
Notice that 'b' does not result in the merging of the values within an array. The underlying library does not
|
Notice that 'b' does not result in the merging of the values within an array.
|
||||||
currently handle merging values within an array.
|
|
||||||
|
### Append values with arrays
|
||||||
|
Given a data1.yaml file of:
|
||||||
|
```yaml
|
||||||
|
a: simple
|
||||||
|
b: [1, 2]
|
||||||
|
d: hi
|
||||||
|
```
|
||||||
|
and data3.yaml file of:
|
||||||
|
```yaml
|
||||||
|
a: something
|
||||||
|
b: [3, 4]
|
||||||
|
c:
|
||||||
|
test: 2
|
||||||
|
other: true
|
||||||
|
```
|
||||||
|
then
|
||||||
|
```bash
|
||||||
|
yq m -a data1.yaml data3.yaml
|
||||||
|
```
|
||||||
|
will output:
|
||||||
|
```yaml
|
||||||
|
a: simple
|
||||||
|
b: [1, 2, 3, 4]
|
||||||
|
c:
|
||||||
|
test: 2
|
||||||
|
other: true
|
||||||
|
d: hi
|
||||||
|
```
|
||||||
|
|
||||||
|
Note that the 'b' array has concatenated the values from the second data file. Also note that other map keys are not overridden (field a).
|
||||||
|
|
||||||
|
Append cannot be used with overwrite, if both flags are given then append is ignored.
|
||||||
|
|
||||||
|
### Multiple Documents - merge into single document
|
||||||
|
Currently yq only has multi-document support for the _first_ document being merged into. The remaining yaml files will have their first document selected.
|
||||||
|
|
||||||
|
Given a data1.yaml file of:
|
||||||
|
```yaml
|
||||||
|
something: else
|
||||||
|
---
|
||||||
|
a: simple
|
||||||
|
b: cat
|
||||||
|
```
|
||||||
|
and data3.yaml file of:
|
||||||
|
```yaml
|
||||||
|
b: dog
|
||||||
|
```
|
||||||
|
then
|
||||||
|
```bash
|
||||||
|
yq m -x -d1 data1.yaml data3.yaml
|
||||||
|
```
|
||||||
|
will output:
|
||||||
|
```yaml
|
||||||
|
something: else
|
||||||
|
---
|
||||||
|
a: simple
|
||||||
|
b: dog
|
||||||
|
```
|
||||||
|
|
||||||
|
### Multiple Documents - merge into all documents
|
||||||
|
Currently yq only has multi-document support for the _first_ document being merged into. The remaining yaml files will have their first document selected.
|
||||||
|
|
||||||
|
Given a data1.yaml file of:
|
||||||
|
```yaml
|
||||||
|
something: else
|
||||||
|
---
|
||||||
|
a: simple
|
||||||
|
b: cat
|
||||||
|
```
|
||||||
|
and data3.yaml file of:
|
||||||
|
```yaml
|
||||||
|
b: dog
|
||||||
|
```
|
||||||
|
then
|
||||||
|
```bash
|
||||||
|
yq m -x -d'*' data1.yaml data3.yaml
|
||||||
|
```
|
||||||
|
will output:
|
||||||
|
```yaml
|
||||||
|
b: dog
|
||||||
|
something: else
|
||||||
|
---
|
||||||
|
a: simple
|
||||||
|
b: dog
|
||||||
|
```
|
||||||
@@ -43,6 +43,45 @@ will output
|
|||||||
- apples
|
- apples
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Multiple Documents - specify a single document
|
||||||
|
Given a sample.yaml file of:
|
||||||
|
```yaml
|
||||||
|
something: else
|
||||||
|
---
|
||||||
|
b:
|
||||||
|
c: 2
|
||||||
|
```
|
||||||
|
then
|
||||||
|
```bash
|
||||||
|
yq r -d1 sample.yaml b.c
|
||||||
|
```
|
||||||
|
will output the value of '2'.
|
||||||
|
|
||||||
|
### Multiple Documents - read all documents
|
||||||
|
Reading all documents will return the result as an array. This can be converted to json using the '-j' flag if desired.
|
||||||
|
|
||||||
|
Given a sample.yaml file of:
|
||||||
|
```yaml
|
||||||
|
name: Fred
|
||||||
|
age: 22
|
||||||
|
---
|
||||||
|
name: Stella
|
||||||
|
age: 23
|
||||||
|
---
|
||||||
|
name: Android
|
||||||
|
age: 232
|
||||||
|
```
|
||||||
|
then
|
||||||
|
```bash
|
||||||
|
yq r -d'*' sample.yaml name
|
||||||
|
```
|
||||||
|
will output:
|
||||||
|
```
|
||||||
|
- Fred
|
||||||
|
- Stella
|
||||||
|
- Android
|
||||||
|
```
|
||||||
|
|
||||||
### Arrays
|
### Arrays
|
||||||
You can give an index to access a specific element:
|
You can give an index to access a specific element:
|
||||||
e.g.: given a sample file of
|
e.g.: given a sample file of
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
```
|
```
|
||||||
yq w <yaml_file|json_file> <path> <new value>
|
yq w <yaml_file> <path> <new value>
|
||||||
```
|
```
|
||||||
{!snippets/works_with_json.md!}
|
|
||||||
|
|
||||||
### To Stdout
|
### To Stdout
|
||||||
Given a sample.yaml file of:
|
Given a sample.yaml file of:
|
||||||
@@ -69,6 +68,50 @@ b:
|
|||||||
|
|
||||||
Note that the path is in quotes to avoid the square brackets being interpreted by your shell.
|
Note that the path is in quotes to avoid the square brackets being interpreted by your shell.
|
||||||
|
|
||||||
|
### Multiple Documents - update a single document
|
||||||
|
Given a sample.yaml file of:
|
||||||
|
```yaml
|
||||||
|
something: else
|
||||||
|
---
|
||||||
|
b:
|
||||||
|
c: 2
|
||||||
|
```
|
||||||
|
then
|
||||||
|
```bash
|
||||||
|
yq w -d1 sample.yaml b.c 5
|
||||||
|
```
|
||||||
|
will output:
|
||||||
|
```yaml
|
||||||
|
something: else
|
||||||
|
---
|
||||||
|
b:
|
||||||
|
c: 5
|
||||||
|
```
|
||||||
|
|
||||||
|
### Multiple Documents - update all documents
|
||||||
|
Given a sample.yaml file of:
|
||||||
|
```yaml
|
||||||
|
something: else
|
||||||
|
---
|
||||||
|
b:
|
||||||
|
c: 2
|
||||||
|
```
|
||||||
|
then
|
||||||
|
```bash
|
||||||
|
yq w -d'*' sample.yaml b.c 5
|
||||||
|
```
|
||||||
|
will output:
|
||||||
|
```yaml
|
||||||
|
something: else
|
||||||
|
b:
|
||||||
|
c: 5
|
||||||
|
---
|
||||||
|
b:
|
||||||
|
c: 5
|
||||||
|
```
|
||||||
|
|
||||||
|
Note that '*' is in quotes to avoid being interpreted by your shell.
|
||||||
|
|
||||||
### Updating files in-place
|
### Updating files in-place
|
||||||
Given a sample.yaml file of:
|
Given a sample.yaml file of:
|
||||||
```yaml
|
```yaml
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
- increment version in version.go
|
- increment version in version.go
|
||||||
- increment version in snapcraft.yaml
|
- increment version in snapcraft.yaml
|
||||||
- tag git with same version number
|
- tag git with same version number
|
||||||
|
- dont tag with 'v' for release this can break peoples things?
|
||||||
|
- be sure to also tag with 'v' for gopkg.in
|
||||||
- make sure local build passes
|
- make sure local build passes
|
||||||
- push tag to git
|
- push tag to git
|
||||||
- make local xcompile (builds binaries for all platforms)
|
- make local xcompile (builds binaries for all platforms)
|
||||||
@@ -10,6 +12,13 @@
|
|||||||
|
|
||||||
- snapcraft
|
- snapcraft
|
||||||
- will auto create a candidate, test it works then promote
|
- will auto create a candidate, test it works then promote
|
||||||
|
- see https://build.snapcraft.io/user/mikefarah/yq
|
||||||
|
|
||||||
|
sudo snap remove yq
|
||||||
|
sudo snap install --edge yq
|
||||||
|
|
||||||
|
then on the mac snapcraft release yq <snap_build_number> stable
|
||||||
|
|
||||||
|
|
||||||
- brew
|
- brew
|
||||||
- create pull request pointing to latest git release
|
- create pull request pointing to latest git release
|
||||||
|
|||||||
@@ -4,4 +4,6 @@
|
|||||||
# at https://github.com/inconshreveable/gonative
|
# at https://github.com/inconshreveable/gonative
|
||||||
|
|
||||||
gox -ldflags "${LDFLAGS}" -output="build/{{.Dir}}_{{.OS}}_{{.Arch}}"
|
gox -ldflags "${LDFLAGS}" -output="build/{{.Dir}}_{{.OS}}_{{.Arch}}"
|
||||||
|
# include non-default linux builds too
|
||||||
|
gox -ldflags "${LDFLAGS}" -os=linux -output="build/{{.Dir}}_{{.OS}}_{{.Arch}}"
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
name: yq
|
name: yq
|
||||||
version: 1.15.0
|
version: 2.1.2
|
||||||
summary: A lightweight and portable command-line YAML processor
|
summary: A lightweight and portable command-line YAML processor
|
||||||
description: |
|
description: |
|
||||||
The aim of the project is to be the jq or sed of yaml files.
|
The aim of the project is to be the jq or sed of yaml files.
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
yaml "gopkg.in/mikefarah/yaml.v2"
|
||||||
yaml "gopkg.in/yaml.v2"
|
"gopkg.in/spf13/cobra.v0"
|
||||||
)
|
)
|
||||||
|
|
||||||
type resulter struct {
|
type resulter struct {
|
||||||
|
|||||||
50
vendor/vendor.json
vendored
50
vendor/vendor.json
vendored
@@ -2,24 +2,12 @@
|
|||||||
"comment": "",
|
"comment": "",
|
||||||
"ignore": "test",
|
"ignore": "test",
|
||||||
"package": [
|
"package": [
|
||||||
{
|
|
||||||
"checksumSHA1": "66lykxpWgSmQodnhkADqn6tnroQ=",
|
|
||||||
"path": "github.com/imdario/mergo",
|
|
||||||
"revision": "e3000cb3d28c72b837601cac94debd91032d19fe",
|
|
||||||
"revisionTime": "2017-06-20T10:47:01Z"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"checksumSHA1": "40vJyUB4ezQSn/NSadsKEOrudMc=",
|
"checksumSHA1": "40vJyUB4ezQSn/NSadsKEOrudMc=",
|
||||||
"path": "github.com/inconshreveable/mousetrap",
|
"path": "github.com/inconshreveable/mousetrap",
|
||||||
"revision": "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75",
|
"revision": "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75",
|
||||||
"revisionTime": "2014-10-17T20:07:13Z"
|
"revisionTime": "2014-10-17T20:07:13Z"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"checksumSHA1": "BoXdUBWB8UnSlFlbnuTQaPqfCGk=",
|
|
||||||
"path": "github.com/op/go-logging",
|
|
||||||
"revision": "970db520ece77730c7e4724c61121037378659d9",
|
|
||||||
"revisionTime": "2016-03-15T20:05:05Z"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"checksumSHA1": "ljd3FhYRJ91cLZz3wsH9BQQ2JbA=",
|
"checksumSHA1": "ljd3FhYRJ91cLZz3wsH9BQQ2JbA=",
|
||||||
"path": "github.com/pkg/errors",
|
"path": "github.com/pkg/errors",
|
||||||
@@ -27,24 +15,34 @@
|
|||||||
"revisionTime": "2018-03-11T21:45:15Z"
|
"revisionTime": "2018-03-11T21:45:15Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"checksumSHA1": "xPKgXygsORkmXnLdtFaFmipYKaA=",
|
"checksumSHA1": "OJI0OgC5V8gZtfS1e0CDYMhkDNc=",
|
||||||
"path": "github.com/spf13/cobra",
|
|
||||||
"revision": "b78744579491c1ceeaaa3b40205e56b0591b93a3",
|
|
||||||
"revisionTime": "2017-09-05T17:20:51Z"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"checksumSHA1": "Q52Y7t0lEtk/wcDn5q7tS7B+jqs=",
|
|
||||||
"path": "github.com/spf13/pflag",
|
"path": "github.com/spf13/pflag",
|
||||||
"revision": "7aff26db30c1be810f9de5038ec5ef96ac41fd7c",
|
"revision": "3ebe029320b2676d667ae88da602a5f854788a8a",
|
||||||
"revisionTime": "2017-08-24T17:57:12Z"
|
"revisionTime": "2018-06-01T13:25:42Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"checksumSHA1": "DHNYKS5T54/XOqUsFFzdZMLEnVE=",
|
"checksumSHA1": "RwlkCZz8VFXAE4aHQQOSC0hLu5k=",
|
||||||
"origin": "github.com/mikefarah/yaml",
|
"path": "gopkg.in/imdario/mergo.v0",
|
||||||
"path": "gopkg.in/yaml.v2",
|
"revision": "9316a62528ac99aaecb4e47eadd6dc8aa6533d58",
|
||||||
|
"revisionTime": "2018-06-08T14:01:56Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "7wtGubs4v7+RZovtlmyT9KwA/gE=",
|
||||||
|
"path": "gopkg.in/mikefarah/yaml.v2",
|
||||||
"revision": "e175af14aaa1d0eff2ee04b691e4a4827a111416",
|
"revision": "e175af14aaa1d0eff2ee04b691e4a4827a111416",
|
||||||
"revisionTime": "2018-06-13T04:05:11Z",
|
"revisionTime": "2018-06-13T04:05:11Z"
|
||||||
"tree": true
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "rL5r44ASTGubGW88gqQwlvVQshw=",
|
||||||
|
"path": "gopkg.in/op/go-logging.v1",
|
||||||
|
"revision": "b2cb9fa56473e98db8caba80237377e83fe44db5",
|
||||||
|
"revisionTime": "2016-02-11T21:21:56Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "xsZjAbfLrXcMtY6fyQ8QC6EvJD0=",
|
||||||
|
"path": "gopkg.in/spf13/cobra.v0",
|
||||||
|
"revision": "ef82de70bb3f60c65fb8eebacbb2d122ef517385",
|
||||||
|
"revisionTime": "2018-04-27T13:45:50Z"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"rootPath": "github.com/mikefarah/yq"
|
"rootPath": "github.com/mikefarah/yq"
|
||||||
|
|||||||
@@ -11,12 +11,12 @@ var (
|
|||||||
GitDescribe string
|
GitDescribe string
|
||||||
|
|
||||||
// Version is main version number that is being run at the moment.
|
// Version is main version number that is being run at the moment.
|
||||||
Version = "2.0.0"
|
Version = "2.1.2"
|
||||||
|
|
||||||
// VersionPrerelease is a pre-release marker for the version. If this is "" (empty string)
|
// 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
|
// then it means that it is a final release. Otherwise, this is a pre-release
|
||||||
// such as "dev" (in development), "beta", "rc1", etc.
|
// such as "dev" (in development), "beta", "rc1", etc.
|
||||||
VersionPrerelease = "beta"
|
VersionPrerelease = ""
|
||||||
)
|
)
|
||||||
|
|
||||||
// ProductName is the name of the product
|
// ProductName is the name of the product
|
||||||
|
|||||||
@@ -3,13 +3,18 @@ package main
|
|||||||
import "testing"
|
import "testing"
|
||||||
|
|
||||||
func TestGetVersionDisplay(t *testing.T) {
|
func TestGetVersionDisplay(t *testing.T) {
|
||||||
|
var expectedVersion = ProductName + " version " + Version
|
||||||
|
if VersionPrerelease != "" {
|
||||||
|
expectedVersion = expectedVersion + "-" + VersionPrerelease
|
||||||
|
}
|
||||||
|
expectedVersion = expectedVersion + "\n"
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
want string
|
want string
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
name: "Display Version",
|
name: "Display Version",
|
||||||
want: ProductName + " version " + Version + "-" + VersionPrerelease + "\n",
|
want: expectedVersion,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
|
|||||||
202
yq.go
202
yq.go
@@ -12,9 +12,9 @@ import (
|
|||||||
|
|
||||||
errors "github.com/pkg/errors"
|
errors "github.com/pkg/errors"
|
||||||
|
|
||||||
logging "github.com/op/go-logging"
|
yaml "gopkg.in/mikefarah/yaml.v2"
|
||||||
"github.com/spf13/cobra"
|
logging "gopkg.in/op/go-logging.v1"
|
||||||
yaml "gopkg.in/yaml.v2"
|
cobra "gopkg.in/spf13/cobra.v0"
|
||||||
)
|
)
|
||||||
|
|
||||||
var trimOutput = true
|
var trimOutput = true
|
||||||
@@ -22,9 +22,10 @@ var writeInplace = false
|
|||||||
var writeScript = ""
|
var writeScript = ""
|
||||||
var outputToJSON = false
|
var outputToJSON = false
|
||||||
var overwriteFlag = false
|
var overwriteFlag = false
|
||||||
|
var appendFlag = false
|
||||||
var verbose = false
|
var verbose = false
|
||||||
var version = false
|
var version = false
|
||||||
var docIndex = 0
|
var docIndex = "0"
|
||||||
var log = logging.MustGetLogger("yq")
|
var log = logging.MustGetLogger("yq")
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -66,7 +67,6 @@ func newCommandCLI() *cobra.Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rootCmd.PersistentFlags().BoolVarP(&trimOutput, "trim", "t", true, "trim yaml output")
|
rootCmd.PersistentFlags().BoolVarP(&trimOutput, "trim", "t", true, "trim yaml output")
|
||||||
rootCmd.PersistentFlags().BoolVarP(&outputToJSON, "tojson", "j", false, "output as json")
|
|
||||||
rootCmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "verbose mode")
|
rootCmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "verbose mode")
|
||||||
rootCmd.Flags().BoolVarP(&version, "version", "V", false, "Print version information and quit")
|
rootCmd.Flags().BoolVarP(&version, "version", "V", false, "Print version information and quit")
|
||||||
|
|
||||||
@@ -86,7 +86,7 @@ func createReadCmd() *cobra.Command {
|
|||||||
var cmdRead = &cobra.Command{
|
var cmdRead = &cobra.Command{
|
||||||
Use: "read [yaml_file] [path]",
|
Use: "read [yaml_file] [path]",
|
||||||
Aliases: []string{"r"},
|
Aliases: []string{"r"},
|
||||||
Short: "yq r [--doc/-d document_index] sample.yaml a.b.c",
|
Short: "yq r [--doc/-d index] sample.yaml a.b.c",
|
||||||
Example: `
|
Example: `
|
||||||
yq read things.yaml a.b.c
|
yq read things.yaml a.b.c
|
||||||
yq r - a.b.c (reads from stdin)
|
yq r - a.b.c (reads from stdin)
|
||||||
@@ -97,7 +97,8 @@ yq r things.yaml a.array[*].blah
|
|||||||
Long: "Outputs the value of the given path in the yaml file to STDOUT",
|
Long: "Outputs the value of the given path in the yaml file to STDOUT",
|
||||||
RunE: readProperty,
|
RunE: readProperty,
|
||||||
}
|
}
|
||||||
cmdRead.PersistentFlags().IntVarP(&docIndex, "doc", "d", 0, "process document index number (0 based)")
|
cmdRead.PersistentFlags().StringVarP(&docIndex, "doc", "d", "0", "process document index number (0 based, * for all documents)")
|
||||||
|
cmdRead.PersistentFlags().BoolVarP(&outputToJSON, "tojson", "j", false, "output as json")
|
||||||
return cmdRead
|
return cmdRead
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,7 +106,7 @@ func createWriteCmd() *cobra.Command {
|
|||||||
var cmdWrite = &cobra.Command{
|
var cmdWrite = &cobra.Command{
|
||||||
Use: "write [yaml_file] [path] [value]",
|
Use: "write [yaml_file] [path] [value]",
|
||||||
Aliases: []string{"w"},
|
Aliases: []string{"w"},
|
||||||
Short: "yq w [--inplace/-i] [--script/-s script_file] [--doc/-d document_index] sample.yaml a.b.c newValueForC",
|
Short: "yq w [--inplace/-i] [--script/-s script_file] [--doc/-d index] sample.yaml a.b.c newValue",
|
||||||
Example: `
|
Example: `
|
||||||
yq write things.yaml a.b.c cat
|
yq write things.yaml a.b.c cat
|
||||||
yq write --inplace things.yaml a.b.c cat
|
yq write --inplace things.yaml a.b.c cat
|
||||||
@@ -132,7 +133,7 @@ a.b.e:
|
|||||||
}
|
}
|
||||||
cmdWrite.PersistentFlags().BoolVarP(&writeInplace, "inplace", "i", false, "update the yaml file inplace")
|
cmdWrite.PersistentFlags().BoolVarP(&writeInplace, "inplace", "i", false, "update the yaml file inplace")
|
||||||
cmdWrite.PersistentFlags().StringVarP(&writeScript, "script", "s", "", "yaml script for updating yaml")
|
cmdWrite.PersistentFlags().StringVarP(&writeScript, "script", "s", "", "yaml script for updating yaml")
|
||||||
cmdWrite.PersistentFlags().IntVarP(&docIndex, "doc", "d", 0, "process document index number (0 based)")
|
cmdWrite.PersistentFlags().StringVarP(&docIndex, "doc", "d", "0", "process document index number (0 based, * for all documents)")
|
||||||
return cmdWrite
|
return cmdWrite
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -140,7 +141,7 @@ func createDeleteCmd() *cobra.Command {
|
|||||||
var cmdDelete = &cobra.Command{
|
var cmdDelete = &cobra.Command{
|
||||||
Use: "delete [yaml_file] [path]",
|
Use: "delete [yaml_file] [path]",
|
||||||
Aliases: []string{"d"},
|
Aliases: []string{"d"},
|
||||||
Short: "yq d [--inplace/-i] [--doc/-d document_index] sample.yaml a.b.c",
|
Short: "yq d [--inplace/-i] [--doc/-d index] sample.yaml a.b.c",
|
||||||
Example: `
|
Example: `
|
||||||
yq delete things.yaml a.b.c
|
yq delete things.yaml a.b.c
|
||||||
yq delete --inplace things.yaml a.b.c
|
yq delete --inplace things.yaml a.b.c
|
||||||
@@ -153,7 +154,7 @@ Outputs to STDOUT unless the inplace flag is used, in which case the file is upd
|
|||||||
RunE: deleteProperty,
|
RunE: deleteProperty,
|
||||||
}
|
}
|
||||||
cmdDelete.PersistentFlags().BoolVarP(&writeInplace, "inplace", "i", false, "update the yaml file inplace")
|
cmdDelete.PersistentFlags().BoolVarP(&writeInplace, "inplace", "i", false, "update the yaml file inplace")
|
||||||
cmdDelete.PersistentFlags().IntVarP(&docIndex, "doc", "d", 0, "process document index number (0 based)")
|
cmdDelete.PersistentFlags().StringVarP(&docIndex, "doc", "d", "0", "process document index number (0 based, * for all documents)")
|
||||||
return cmdDelete
|
return cmdDelete
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,7 +162,7 @@ func createNewCmd() *cobra.Command {
|
|||||||
var cmdNew = &cobra.Command{
|
var cmdNew = &cobra.Command{
|
||||||
Use: "new [path] [value]",
|
Use: "new [path] [value]",
|
||||||
Aliases: []string{"n"},
|
Aliases: []string{"n"},
|
||||||
Short: "yq n [--script/-s script_file] a.b.c newValueForC",
|
Short: "yq n [--script/-s script_file] a.b.c newValue",
|
||||||
Example: `
|
Example: `
|
||||||
yq new a.b.c cat
|
yq new a.b.c cat
|
||||||
yq n a.b.c cat
|
yq n a.b.c cat
|
||||||
@@ -183,33 +184,83 @@ func createMergeCmd() *cobra.Command {
|
|||||||
var cmdMerge = &cobra.Command{
|
var cmdMerge = &cobra.Command{
|
||||||
Use: "merge [initial_yaml_file] [additional_yaml_file]...",
|
Use: "merge [initial_yaml_file] [additional_yaml_file]...",
|
||||||
Aliases: []string{"m"},
|
Aliases: []string{"m"},
|
||||||
Short: "yq m [--inplace/-i] [--doc/-d document_index] [--overwrite/-x] sample.yaml sample2.yaml",
|
Short: "yq m [--inplace/-i] [--doc/-d index] [--overwrite/-x] [--append/-a] sample.yaml sample2.yaml",
|
||||||
Example: `
|
Example: `
|
||||||
yq merge things.yaml other.yaml
|
yq merge things.yaml other.yaml
|
||||||
yq merge --inplace things.yaml other.yaml
|
yq merge --inplace things.yaml other.yaml
|
||||||
yq m -i things.yaml other.yaml
|
yq m -i things.yaml other.yaml
|
||||||
yq m --overwrite things.yaml other.yaml
|
yq m --overwrite things.yaml other.yaml
|
||||||
yq m -i -x things.yaml other.yaml
|
yq m -i -x things.yaml other.yaml
|
||||||
|
yq m -i -a things.yaml other.yaml
|
||||||
`,
|
`,
|
||||||
Long: `Updates the yaml file by adding/updating the path(s) and value(s) from additional yaml file(s).
|
Long: `Updates the yaml file by adding/updating the path(s) and value(s) from additional yaml file(s).
|
||||||
Outputs to STDOUT unless the inplace flag is used, in which case the file is updated instead.
|
Outputs to STDOUT unless the inplace flag is used, in which case the file is updated instead.
|
||||||
|
|
||||||
If overwrite flag is set then existing values will be overwritten using the values from each additional yaml file.
|
If overwrite flag is set then existing values will be overwritten using the values from each additional yaml file.
|
||||||
|
If append flag is set then existing arrays will be merged with the arrays from each additional yaml file.
|
||||||
|
|
||||||
|
Note that if you set both flags only overwrite will take effect.
|
||||||
`,
|
`,
|
||||||
RunE: mergeProperties,
|
RunE: mergeProperties,
|
||||||
}
|
}
|
||||||
cmdMerge.PersistentFlags().BoolVarP(&writeInplace, "inplace", "i", false, "update the yaml file inplace")
|
cmdMerge.PersistentFlags().BoolVarP(&writeInplace, "inplace", "i", false, "update the yaml file inplace")
|
||||||
cmdMerge.PersistentFlags().BoolVarP(&overwriteFlag, "overwrite", "x", false, "update the yaml file by overwriting existing values")
|
cmdMerge.PersistentFlags().BoolVarP(&overwriteFlag, "overwrite", "x", false, "update the yaml file by overwriting existing values")
|
||||||
cmdMerge.PersistentFlags().IntVarP(&docIndex, "doc", "d", 0, "process document index number (0 based)")
|
cmdMerge.PersistentFlags().BoolVarP(&appendFlag, "append", "a", false, "update the yaml file by appending array values")
|
||||||
|
cmdMerge.PersistentFlags().StringVarP(&docIndex, "doc", "d", "0", "process document index number (0 based, * for all documents)")
|
||||||
return cmdMerge
|
return cmdMerge
|
||||||
}
|
}
|
||||||
|
|
||||||
func readProperty(cmd *cobra.Command, args []string) error {
|
func readProperty(cmd *cobra.Command, args []string) error {
|
||||||
data, err := read(args)
|
var path = ""
|
||||||
if err != nil {
|
|
||||||
return err
|
if len(args) < 1 {
|
||||||
|
return errors.New("Must provide filename")
|
||||||
|
} else if len(args) > 1 {
|
||||||
|
path = args[1]
|
||||||
}
|
}
|
||||||
dataStr, err := toString(data)
|
|
||||||
|
var updateAll, docIndexInt, errorParsingDocIndex = parseDocumentIndex()
|
||||||
|
if errorParsingDocIndex != nil {
|
||||||
|
return errorParsingDocIndex
|
||||||
|
}
|
||||||
|
var mappedDocs []interface{}
|
||||||
|
var dataBucket interface{}
|
||||||
|
var currentIndex = 0
|
||||||
|
var errorReadingStream = readStream(args[0], func(decoder *yaml.Decoder) error {
|
||||||
|
for {
|
||||||
|
errorReading := decoder.Decode(&dataBucket)
|
||||||
|
if errorReading == io.EOF {
|
||||||
|
log.Debugf("done %v / %v", currentIndex, docIndexInt)
|
||||||
|
if !updateAll && currentIndex <= docIndexInt {
|
||||||
|
return fmt.Errorf("Asked to process document index %v but there are only %v document(s)", docIndex, currentIndex)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
log.Debugf("processing %v - requested index %v", currentIndex, docIndexInt)
|
||||||
|
if updateAll || currentIndex == docIndexInt {
|
||||||
|
log.Debugf("reading %v in index %v", path, currentIndex)
|
||||||
|
mappedDoc, errorParsing := readPath(dataBucket, path)
|
||||||
|
log.Debugf("%v", mappedDoc)
|
||||||
|
if errorParsing != nil {
|
||||||
|
return errors.Wrapf(errorParsing, "Error reading path in document index %v", currentIndex)
|
||||||
|
}
|
||||||
|
mappedDocs = append(mappedDocs, mappedDoc)
|
||||||
|
}
|
||||||
|
currentIndex = currentIndex + 1
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
if errorReadingStream != nil {
|
||||||
|
return errorReadingStream
|
||||||
|
}
|
||||||
|
|
||||||
|
if !updateAll {
|
||||||
|
dataBucket = mappedDocs[0]
|
||||||
|
} else {
|
||||||
|
dataBucket = mappedDocs
|
||||||
|
}
|
||||||
|
|
||||||
|
dataStr, err := toString(dataBucket)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -217,25 +268,13 @@ func readProperty(cmd *cobra.Command, args []string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func read(args []string) (interface{}, error) {
|
func readPath(dataBucket interface{}, path string) (interface{}, error) {
|
||||||
var path = ""
|
|
||||||
|
|
||||||
if len(args) < 1 {
|
|
||||||
return nil, errors.New("Must provide filename")
|
|
||||||
} else if len(args) > 1 {
|
|
||||||
path = args[1]
|
|
||||||
}
|
|
||||||
var generalData interface{}
|
|
||||||
if err := readData(args[0], docIndex, &generalData); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if path == "" {
|
if path == "" {
|
||||||
return generalData, nil
|
log.Debug("no path")
|
||||||
|
return dataBucket, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var paths = parsePath(path)
|
var paths = parsePath(path)
|
||||||
value, err := recurse(generalData, paths[0], paths[1:])
|
return recurse(dataBucket, paths[0], paths[1:])
|
||||||
return value, err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func newProperty(cmd *cobra.Command, args []string) error {
|
func newProperty(cmd *cobra.Command, args []string) error {
|
||||||
@@ -276,6 +315,17 @@ func newYaml(args []string) (interface{}, error) {
|
|||||||
return dataBucket, nil
|
return dataBucket, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func parseDocumentIndex() (bool, int, error) {
|
||||||
|
if docIndex == "*" {
|
||||||
|
return true, -1, nil
|
||||||
|
}
|
||||||
|
docIndexInt64, err := strconv.ParseInt(docIndex, 10, 32)
|
||||||
|
if err != nil {
|
||||||
|
return false, -1, errors.Wrapf(err, "Document index %v is not a integer or *", docIndex)
|
||||||
|
}
|
||||||
|
return false, int(docIndexInt64), nil
|
||||||
|
}
|
||||||
|
|
||||||
type updateDataFn func(dataBucket interface{}, currentIndex int) (interface{}, error)
|
type updateDataFn func(dataBucket interface{}, currentIndex int) (interface{}, error)
|
||||||
|
|
||||||
func mapYamlDecoder(updateData updateDataFn, encoder *yaml.Encoder) yamlDecoderFn {
|
func mapYamlDecoder(updateData updateDataFn, encoder *yaml.Encoder) yamlDecoderFn {
|
||||||
@@ -286,13 +336,18 @@ func mapYamlDecoder(updateData updateDataFn, encoder *yaml.Encoder) yamlDecoderF
|
|||||||
var errorUpdating error
|
var errorUpdating error
|
||||||
var currentIndex = 0
|
var currentIndex = 0
|
||||||
|
|
||||||
|
var updateAll, docIndexInt, errorParsingDocIndex = parseDocumentIndex()
|
||||||
|
if errorParsingDocIndex != nil {
|
||||||
|
return errorParsingDocIndex
|
||||||
|
}
|
||||||
|
|
||||||
for {
|
for {
|
||||||
log.Debugf("Read doc %v", currentIndex)
|
log.Debugf("Read doc %v", currentIndex)
|
||||||
errorReading = decoder.Decode(&dataBucket)
|
errorReading = decoder.Decode(&dataBucket)
|
||||||
|
|
||||||
if errorReading == io.EOF {
|
if errorReading == io.EOF {
|
||||||
if currentIndex < docIndex {
|
if !updateAll && currentIndex <= docIndexInt {
|
||||||
return fmt.Errorf("Asked to process document %v but there are only %v document(s)", docIndex, currentIndex)
|
return fmt.Errorf("Asked to process document index %v but there are only %v document(s)", docIndex, currentIndex)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
} else if errorReading != nil {
|
} else if errorReading != nil {
|
||||||
@@ -318,8 +373,13 @@ func writeProperty(cmd *cobra.Command, args []string) error {
|
|||||||
if writeCommandsError != nil {
|
if writeCommandsError != nil {
|
||||||
return writeCommandsError
|
return writeCommandsError
|
||||||
}
|
}
|
||||||
|
var updateAll, docIndexInt, errorParsingDocIndex = parseDocumentIndex()
|
||||||
|
if errorParsingDocIndex != nil {
|
||||||
|
return errorParsingDocIndex
|
||||||
|
}
|
||||||
|
|
||||||
var updateData = func(dataBucket interface{}, currentIndex int) (interface{}, error) {
|
var updateData = func(dataBucket interface{}, currentIndex int) (interface{}, error) {
|
||||||
if currentIndex == docIndex {
|
if updateAll || currentIndex == docIndexInt {
|
||||||
log.Debugf("Updating doc %v", currentIndex)
|
log.Debugf("Updating doc %v", currentIndex)
|
||||||
for _, entry := range writeCommands {
|
for _, entry := range writeCommands {
|
||||||
path := entry.Key.(string)
|
path := entry.Key.(string)
|
||||||
@@ -338,7 +398,15 @@ func readAndUpdate(stdOut io.Writer, inputFile string, updateData updateDataFn)
|
|||||||
var destination io.Writer
|
var destination io.Writer
|
||||||
var destinationName string
|
var destinationName string
|
||||||
if writeInplace {
|
if writeInplace {
|
||||||
var tempFile, err = ioutil.TempFile("", "temp")
|
info, err := os.Stat(inputFile)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
tempFile, err := ioutil.TempFile("", "temp")
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
err = tempFile.Chmod(info.Mode())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -365,8 +433,13 @@ func deleteProperty(cmd *cobra.Command, args []string) error {
|
|||||||
}
|
}
|
||||||
var deletePath = args[1]
|
var deletePath = args[1]
|
||||||
var paths = parsePath(deletePath)
|
var paths = parsePath(deletePath)
|
||||||
|
var updateAll, docIndexInt, errorParsingDocIndex = parseDocumentIndex()
|
||||||
|
if errorParsingDocIndex != nil {
|
||||||
|
return errorParsingDocIndex
|
||||||
|
}
|
||||||
|
|
||||||
var updateData = func(dataBucket interface{}, currentIndex int) (interface{}, error) {
|
var updateData = func(dataBucket interface{}, currentIndex int) (interface{}, error) {
|
||||||
if currentIndex == docIndex {
|
if updateAll || currentIndex == docIndexInt {
|
||||||
log.Debugf("Deleting path in doc %v", currentIndex)
|
log.Debugf("Deleting path in doc %v", currentIndex)
|
||||||
return deleteChildValue(dataBucket, paths), nil
|
return deleteChildValue(dataBucket, paths), nil
|
||||||
}
|
}
|
||||||
@@ -382,12 +455,20 @@ func mergeProperties(cmd *cobra.Command, args []string) error {
|
|||||||
}
|
}
|
||||||
var input = args[0]
|
var input = args[0]
|
||||||
var filesToMerge = args[1:]
|
var filesToMerge = args[1:]
|
||||||
|
var updateAll, docIndexInt, errorParsingDocIndex = parseDocumentIndex()
|
||||||
|
if errorParsingDocIndex != nil {
|
||||||
|
return errorParsingDocIndex
|
||||||
|
}
|
||||||
|
|
||||||
var updateData = func(dataBucket interface{}, currentIndex int) (interface{}, error) {
|
var updateData = func(dataBucket interface{}, currentIndex int) (interface{}, error) {
|
||||||
if currentIndex == docIndex {
|
if updateAll || currentIndex == docIndexInt {
|
||||||
log.Debugf("Merging doc %v", currentIndex)
|
log.Debugf("Merging doc %v", currentIndex)
|
||||||
var mergedData map[interface{}]interface{}
|
var mergedData map[interface{}]interface{}
|
||||||
if err := merge(&mergedData, dataBucket, overwriteFlag); err != nil {
|
// merge only works for maps, so put everything in a temporary
|
||||||
|
// map
|
||||||
|
var mapDataBucket = make(map[interface{}]interface{})
|
||||||
|
mapDataBucket["root"] = dataBucket
|
||||||
|
if err := merge(&mergedData, mapDataBucket, overwriteFlag, appendFlag); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
for _, f := range filesToMerge {
|
for _, f := range filesToMerge {
|
||||||
@@ -395,11 +476,12 @@ func mergeProperties(cmd *cobra.Command, args []string) error {
|
|||||||
if err := readData(f, 0, &fileToMerge); err != nil {
|
if err := readData(f, 0, &fileToMerge); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if err := merge(&mergedData, fileToMerge, overwriteFlag); err != nil {
|
mapDataBucket["root"] = fileToMerge
|
||||||
|
if err := merge(&mergedData, mapDataBucket, overwriteFlag, appendFlag); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return mergedData, nil
|
return mergedData["root"], nil
|
||||||
}
|
}
|
||||||
return dataBucket, nil
|
return dataBucket, nil
|
||||||
}
|
}
|
||||||
@@ -476,12 +558,36 @@ func marshalContext(context interface{}) (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func safelyRenameFile(from string, to string) {
|
func safelyRenameFile(from string, to string) {
|
||||||
if err := os.Rename(from, to); err != nil {
|
if renameError := os.Rename(from, to); renameError != nil {
|
||||||
log.Errorf("Error renaming from %v to %v", from, to)
|
log.Warningf("Error renaming from %v to %v, attemting to copy contents", from, to)
|
||||||
log.Error(err.Error())
|
log.Warning(renameError.Error())
|
||||||
|
// can't do this rename when running in docker to a file targeted in a mounted volume,
|
||||||
|
// so gracefully degrade to copying the entire contents.
|
||||||
|
if copyError := copyFileContents(from, to); copyError != nil {
|
||||||
|
log.Errorf("Failed copying from %v to %v", from, to)
|
||||||
|
log.Errorf(copyError.Error())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// thanks https://stackoverflow.com/questions/21060945/simple-way-to-copy-a-file-in-golang
|
||||||
|
func copyFileContents(src, dst string) (err error) {
|
||||||
|
in, err := os.Open(src) // nolint gosec
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
defer safelyCloseFile(in)
|
||||||
|
out, err := os.Create(dst)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
defer safelyCloseFile(out)
|
||||||
|
if _, err = io.Copy(out, in); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return out.Sync()
|
||||||
|
}
|
||||||
|
|
||||||
func safelyFlush(writer *bufio.Writer) {
|
func safelyFlush(writer *bufio.Writer) {
|
||||||
if err := writer.Flush(); err != nil {
|
if err := writer.Flush(); err != nil {
|
||||||
log.Error("Error flushing writer!")
|
log.Error("Error flushing writer!")
|
||||||
@@ -508,7 +614,7 @@ func readStream(filename string, yamlDecoder yamlDecoderFn) error {
|
|||||||
if filename == "-" {
|
if filename == "-" {
|
||||||
stream = bufio.NewReader(os.Stdin)
|
stream = bufio.NewReader(os.Stdin)
|
||||||
} else {
|
} else {
|
||||||
file, err := os.Open(filename)
|
file, err := os.Open(filename) // nolint gosec
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -520,8 +626,6 @@ func readStream(filename string, yamlDecoder yamlDecoderFn) error {
|
|||||||
|
|
||||||
func readData(filename string, indexToRead int, parsedData interface{}) error {
|
func readData(filename string, indexToRead int, parsedData interface{}) error {
|
||||||
return readStream(filename, func(decoder *yaml.Decoder) error {
|
return readStream(filename, func(decoder *yaml.Decoder) error {
|
||||||
// naive implementation of document indexing, decodes all the yaml documents
|
|
||||||
// before the docIndex and throws them away.
|
|
||||||
for currentIndex := 0; currentIndex < indexToRead; currentIndex++ {
|
for currentIndex := 0; currentIndex < indexToRead; currentIndex++ {
|
||||||
errorSkipping := decoder.Decode(parsedData)
|
errorSkipping := decoder.Decode(parsedData)
|
||||||
if errorSkipping != nil {
|
if errorSkipping != nil {
|
||||||
|
|||||||
31
yq_test.go
31
yq_test.go
@@ -23,37 +23,6 @@ func TestParseValue(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestRead(t *testing.T) {
|
|
||||||
result, _ := read([]string{"examples/sample.yaml", "b.c"})
|
|
||||||
assertResult(t, 2, result)
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestReadMulti(t *testing.T) {
|
|
||||||
docIndex = 1
|
|
||||||
result, _ := read([]string{"examples/multiple_docs.yaml", "another.document"})
|
|
||||||
assertResult(t, "here", result)
|
|
||||||
docIndex = 0
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestReadArray(t *testing.T) {
|
|
||||||
result, _ := read([]string{"examples/sample_array.yaml", "[1]"})
|
|
||||||
assertResult(t, 2, result)
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestReadString(t *testing.T) {
|
|
||||||
result, _ := read([]string{"examples/sample_text.yaml"})
|
|
||||||
assertResult(t, "hi", result)
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestOrder(t *testing.T) {
|
|
||||||
result, _ := read([]string{"examples/order.yaml"})
|
|
||||||
formattedResult, _ := yamlToString(result)
|
|
||||||
assertResult(t,
|
|
||||||
`version: 3
|
|
||||||
application: MyApp`,
|
|
||||||
formattedResult)
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestMultilineString(t *testing.T) {
|
func TestMultilineString(t *testing.T) {
|
||||||
testString := `
|
testString := `
|
||||||
abcd
|
abcd
|
||||||
|
|||||||
Reference in New Issue
Block a user