Compare commits
208 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2f9f8665dd | ||
|
|
3dea1efc03 | ||
|
|
547787f3ae | ||
|
|
3e83ff7ac8 | ||
|
|
f18c5161e0 | ||
|
|
eeeeeffd7b | ||
|
|
27604289f4 | ||
|
|
3f36a18791 | ||
|
|
5fc13bdccd | ||
|
|
95fec2984e | ||
|
|
64d1e58f97 | ||
|
|
4b3fbb878f | ||
|
|
26a09e6ec0 | ||
|
|
ceafed30f9 | ||
|
|
b8b2c9de61 | ||
|
|
f5fdf98c38 | ||
|
|
29986db8f8 | ||
|
|
1f4e3a9cde | ||
|
|
b6da773dde | ||
|
|
8020d4253b | ||
|
|
3c701fe98e | ||
|
|
97d1aa2b26 | ||
|
|
d05391e244 | ||
|
|
d1cec1ad18 | ||
|
|
fe5842e5f9 | ||
|
|
e0d8cd6bf6 | ||
|
|
8f5ffe47ff | ||
|
|
5acc1e661e | ||
|
|
a9c0ef571c | ||
|
|
7a28531f2f | ||
|
|
5de2bea1b4 | ||
|
|
7320b8d3c9 | ||
|
|
2f70e6f27a | ||
|
|
a9e871ee00 | ||
|
|
bc4bab9380 | ||
|
|
665d9079fa | ||
|
|
7b54a44fcf | ||
|
|
94148e4398 | ||
|
|
f8553162ca | ||
|
|
be532bf2fe | ||
|
|
e9b8265ca3 | ||
|
|
0f8b864321 | ||
|
|
e5bcfedbe9 | ||
|
|
a5f5fb2562 | ||
|
|
84de9c078d | ||
|
|
c7f5261036 | ||
|
|
6e35356a84 | ||
|
|
b2fe3e6738 | ||
|
|
774badfef4 | ||
|
|
c4e9516aa6 | ||
|
|
323089eb64 | ||
|
|
53289366a5 | ||
|
|
cda9a82906 | ||
|
|
2dbde6b9fb | ||
|
|
f8c1c3c1b4 | ||
|
|
238a1241d2 | ||
|
|
8a61ef072a | ||
|
|
4f178d2317 | ||
|
|
133e55105c | ||
|
|
5e5468af3b | ||
|
|
9b4972e46e | ||
|
|
23543ee031 | ||
|
|
75c7d40c44 | ||
|
|
44b8a5e80f | ||
|
|
77c8f22a79 | ||
|
|
386a0ca3c3 | ||
|
|
53a20d4421 | ||
|
|
478208b7c4 | ||
|
|
1159d0a212 | ||
|
|
8861b392a8 | ||
|
|
16bde80334 | ||
|
|
8a3fb32f36 | ||
|
|
48dcc15281 | ||
|
|
d7040e3933 | ||
|
|
ef579d4ccf | ||
|
|
785ee68a76 | ||
|
|
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 | ||
|
|
867ec92d3a | ||
|
|
113586b5e0 | ||
|
|
c38f19e0a9 | ||
|
|
8ca85b1c64 | ||
|
|
08870f8ec9 | ||
|
|
94b217984c | ||
|
|
2f5a481cc3 | ||
|
|
1a4064429d | ||
|
|
1b22e1d812 | ||
|
|
297522cbdd | ||
|
|
be991fdacd | ||
|
|
be08214773 | ||
|
|
9e971ebeae | ||
|
|
f340db5795 | ||
|
|
ab852ceafa | ||
|
|
06a843e9b2 | ||
|
|
ebdc092688 | ||
|
|
27089d1ca1 | ||
|
|
1853585d22 | ||
|
|
0124d26086 | ||
|
|
0d68bea3dc | ||
|
|
54603b3607 | ||
|
|
c86aeca325 | ||
|
|
a4f124f24f | ||
|
|
090b377fa5 | ||
|
|
3a4d62d820 | ||
|
|
6053c8c136 | ||
|
|
c5a45ba7d5 | ||
|
|
56a0771cd1 | ||
|
|
8072e66d46 | ||
|
|
26153b3eb5 | ||
|
|
f2e10f21c7 | ||
|
|
d3ecf7aa88 | ||
|
|
ee8ffd458a | ||
|
|
8f15dba812 | ||
|
|
92ce195424 | ||
|
|
e725a2cec5 | ||
|
|
37de7a3505 | ||
|
|
e96794a420 | ||
|
|
120ef8e4dc | ||
|
|
db1954da25 | ||
|
|
e552dbb6ab | ||
|
|
298126864f | ||
|
|
d30cd8cc75 | ||
|
|
e6ee86930b | ||
|
|
0ea3c71df7 | ||
|
|
ef99bedf45 | ||
|
|
6e1a5aef2c | ||
|
|
70bd860287 | ||
|
|
0abda0098c | ||
|
|
a409a7e82b | ||
|
|
0e4f9e8579 | ||
|
|
0c932ba7dc | ||
|
|
cb48ba7173 | ||
|
|
dc4f8a6adb | ||
|
|
1f6d7a50b2 | ||
|
|
6fc3bdf58f | ||
|
|
87b33e8603 | ||
|
|
cc7eb84388 | ||
|
|
9e3f8ebd0a | ||
|
|
28bcbd321f | ||
|
|
9dd4503b23 | ||
|
|
185d1faadb | ||
|
|
7b004cb456 | ||
|
|
54c73eb34f | ||
|
|
3b03a0852a | ||
|
|
a00e6c5316 | ||
|
|
9d1a5b17b8 | ||
|
|
c5f80a105d | ||
|
|
c17f8df8f8 | ||
|
|
66c8390d54 | ||
|
|
dda9b1f087 | ||
|
|
683de28c64 | ||
|
|
51fa1a87b7 | ||
|
|
b9ac6a3d9d | ||
|
|
499974c27e | ||
|
|
72bd88cfa5 | ||
|
|
6980be3800 | ||
|
|
2933ea1684 | ||
|
|
cf2f23d747 | ||
|
|
45e9ad870f | ||
|
|
53b2c64747 | ||
|
|
359ca5a117 | ||
|
|
79baa49eaa | ||
|
|
2cda78ce0b | ||
|
|
6d1e61c410 | ||
|
|
86639acf70 | ||
|
|
3beee3f804 | ||
|
|
1ed8e7017e | ||
|
|
5514d2300b | ||
|
|
5bb0934710 |
1
.dockerignore
Normal file
@@ -0,0 +1 @@
|
|||||||
|
bin
|
||||||
13
.gitignore
vendored
@@ -6,7 +6,9 @@
|
|||||||
# Folders
|
# Folders
|
||||||
_obj
|
_obj
|
||||||
_test
|
_test
|
||||||
|
bin
|
||||||
build
|
build
|
||||||
|
build-done
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
# Architecture specific extensions/prefixes
|
# Architecture specific extensions/prefixes
|
||||||
@@ -25,4 +27,13 @@ coverage.out
|
|||||||
*.test
|
*.test
|
||||||
*.prof
|
*.prof
|
||||||
yaml
|
yaml
|
||||||
vendor/*/
|
vendor/
|
||||||
|
tmp/
|
||||||
|
cover/
|
||||||
|
yq
|
||||||
|
|
||||||
|
# snapcraft
|
||||||
|
parts/
|
||||||
|
prime/
|
||||||
|
.snapcraft/
|
||||||
|
yq*.snap
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
language: go
|
language: go
|
||||||
go:
|
go:
|
||||||
- 1.7.x
|
- 1.13.x
|
||||||
script: ./ci.sh
|
script:
|
||||||
|
- scripts/devtools.sh
|
||||||
|
- make local build
|
||||||
|
|||||||
23
Dockerfile
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
FROM golang:1.13 as builder
|
||||||
|
|
||||||
|
WORKDIR /go/src/mikefarah/yq
|
||||||
|
|
||||||
|
# cache devtools
|
||||||
|
COPY ./scripts/devtools.sh /go/src/mikefarah/yq/scripts/devtools.sh
|
||||||
|
RUN ./scripts/devtools.sh
|
||||||
|
|
||||||
|
COPY . /go/src/mikefarah/yq
|
||||||
|
|
||||||
|
RUN CGO_ENABLED=0 make local build
|
||||||
|
|
||||||
|
# Choose alpine as a base image to make this useful for CI, as many
|
||||||
|
# CI tools expect an interactive shell inside the container
|
||||||
|
FROM alpine:3.8 as production
|
||||||
|
|
||||||
|
COPY --from=builder /go/src/mikefarah/yq/yq /usr/bin/yq
|
||||||
|
RUN chmod +x /usr/bin/yq
|
||||||
|
|
||||||
|
ARG VERSION=none
|
||||||
|
LABEL version=${VERSION}
|
||||||
|
|
||||||
|
WORKDIR /workdir
|
||||||
30
Dockerfile.dev
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
FROM golang:1.13
|
||||||
|
|
||||||
|
COPY scripts/devtools.sh /opt/devtools.sh
|
||||||
|
|
||||||
|
RUN set -e -x \
|
||||||
|
&& /opt/devtools.sh
|
||||||
|
|
||||||
|
# install mkdocs
|
||||||
|
RUN set -ex \
|
||||||
|
&& buildDeps=' \
|
||||||
|
build-essential \
|
||||||
|
python-dev \
|
||||||
|
' \
|
||||||
|
&& apt-get update && apt-get install -y --no-install-recommends \
|
||||||
|
$buildDeps \
|
||||||
|
python2.7 \
|
||||||
|
python-setuptools \
|
||||||
|
python-wheel \
|
||||||
|
python-pip \
|
||||||
|
&& pip install --upgrade \
|
||||||
|
pip \
|
||||||
|
'Markdown>=2.6.9' \
|
||||||
|
'mkdocs>=0.16.3' \
|
||||||
|
'mkdocs-material>=1.10.1' \
|
||||||
|
'markdown-include>=0.5.1' \
|
||||||
|
&& apt-get purge -y --auto-remove $buildDeps \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
ENV CGO_ENABLED 0
|
||||||
|
ENV GOPATH /go:/yq
|
||||||
114
Makefile
Normal file
@@ -0,0 +1,114 @@
|
|||||||
|
MAKEFLAGS += --warn-undefined-variables
|
||||||
|
SHELL := /bin/bash
|
||||||
|
.SHELLFLAGS := -o pipefail -euc
|
||||||
|
.DEFAULT_GOAL := install
|
||||||
|
|
||||||
|
include Makefile.variables
|
||||||
|
|
||||||
|
.PHONY: help
|
||||||
|
help:
|
||||||
|
@echo 'Management commands for cicdtest:'
|
||||||
|
@echo
|
||||||
|
@echo 'Usage:'
|
||||||
|
@echo ' ## Develop / Test Commands'
|
||||||
|
@echo ' make build Build yq binary.'
|
||||||
|
@echo ' make install Install yq.'
|
||||||
|
@echo ' make xcompile Build cross-compiled binaries of yq.'
|
||||||
|
@echo ' make vendor Install dependencies to vendor directory.'
|
||||||
|
@echo ' make format Run code formatter.'
|
||||||
|
@echo ' make check Run static code analysis (lint).'
|
||||||
|
@echo ' make test Run tests on project.'
|
||||||
|
@echo ' make cover Run tests and capture code coverage metrics on project.'
|
||||||
|
@echo ' make clean Clean the directory tree of produced artifacts.'
|
||||||
|
@echo
|
||||||
|
@echo ' ## Utility Commands'
|
||||||
|
@echo ' make setup Configures Minishfit/Docker directory mounts.'
|
||||||
|
@echo
|
||||||
|
|
||||||
|
|
||||||
|
.PHONY: clean
|
||||||
|
clean:
|
||||||
|
@rm -rf bin build cover *.out
|
||||||
|
|
||||||
|
## prefix before other make targets to run in your local dev environment
|
||||||
|
local: | quiet
|
||||||
|
@$(eval DOCKRUN= )
|
||||||
|
@mkdir -p tmp
|
||||||
|
@touch tmp/dev_image_id
|
||||||
|
quiet: # this is silly but shuts up 'Nothing to be done for `local`'
|
||||||
|
@:
|
||||||
|
|
||||||
|
prepare: tmp/dev_image_id
|
||||||
|
tmp/dev_image_id: Dockerfile.dev scripts/devtools.sh
|
||||||
|
@mkdir -p tmp
|
||||||
|
@docker rmi -f ${DEV_IMAGE} > /dev/null 2>&1 || true
|
||||||
|
@docker build -t ${DEV_IMAGE} -f Dockerfile.dev .
|
||||||
|
@docker inspect -f "{{ .ID }}" ${DEV_IMAGE} > tmp/dev_image_id
|
||||||
|
|
||||||
|
# ----------------------------------------------
|
||||||
|
# build
|
||||||
|
.PHONY: build
|
||||||
|
build: build/dev
|
||||||
|
|
||||||
|
.PHONY: build/dev
|
||||||
|
build/dev: test *.go
|
||||||
|
@mkdir -p bin/
|
||||||
|
${DOCKRUN} go build --ldflags "$(LDFLAGS)"
|
||||||
|
${DOCKRUN} bash ./scripts/acceptance.sh
|
||||||
|
|
||||||
|
## Compile the project for multiple OS and Architectures.
|
||||||
|
xcompile: check
|
||||||
|
@rm -rf build/
|
||||||
|
@mkdir -p build
|
||||||
|
${DOCKRUN} bash ./scripts/xcompile.sh
|
||||||
|
@find build -type d -exec chmod 755 {} \; || :
|
||||||
|
@find build -type f -exec chmod 755 {} \; || :
|
||||||
|
|
||||||
|
.PHONY: install
|
||||||
|
install: build
|
||||||
|
${DOCKRUN} go install
|
||||||
|
|
||||||
|
# Each of the fetch should be an entry within vendor.json; not currently included within project
|
||||||
|
.PHONY: vendor
|
||||||
|
vendor: tmp/dev_image_id
|
||||||
|
${DOCKRUN} go mod vendor
|
||||||
|
|
||||||
|
# ----------------------------------------------
|
||||||
|
# develop and test
|
||||||
|
|
||||||
|
.PHONY: format
|
||||||
|
format: vendor
|
||||||
|
${DOCKRUN} bash ./scripts/format.sh
|
||||||
|
|
||||||
|
.PHONY: check
|
||||||
|
check: format
|
||||||
|
${DOCKRUN} bash ./scripts/check.sh
|
||||||
|
|
||||||
|
.PHONY: test
|
||||||
|
test: check
|
||||||
|
${DOCKRUN} bash ./scripts/test.sh
|
||||||
|
|
||||||
|
.PHONY: cover
|
||||||
|
cover: check
|
||||||
|
@rm -rf cover/
|
||||||
|
@mkdir -p cover
|
||||||
|
${DOCKRUN} bash ./scripts/coverage.sh
|
||||||
|
@find cover -type d -exec chmod 755 {} \; || :
|
||||||
|
@find cover -type f -exec chmod 644 {} \; || :
|
||||||
|
|
||||||
|
.PHONY: build-docs
|
||||||
|
build-docs: prepare mkdocs.yml mkdocs/*
|
||||||
|
${DOCKRUN} mkdocs build
|
||||||
|
@find docs -type d -exec chmod 755 {} \; || :
|
||||||
|
@find docs -type f -exec chmod 644 {} \; || :
|
||||||
|
|
||||||
|
.PHONY: release
|
||||||
|
release: xcompile
|
||||||
|
${DOCKRUN} bash ./scripts/publish.sh
|
||||||
|
|
||||||
|
# ----------------------------------------------
|
||||||
|
# utilities
|
||||||
|
|
||||||
|
.PHONY: setup
|
||||||
|
setup:
|
||||||
|
@bash ./scripts/setup.sh
|
||||||
38
Makefile.variables
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
export PROJECT = yq
|
||||||
|
IMPORT_PATH := github.com/mikefarah/${PROJECT}
|
||||||
|
|
||||||
|
export GIT_COMMIT = $(shell git rev-parse --short HEAD)
|
||||||
|
export GIT_DIRTY = $(shell test -n "$$(git status --porcelain)" && echo "+CHANGES" || true)
|
||||||
|
export GIT_DESCRIBE = $(shell git describe --tags --always)
|
||||||
|
LDFLAGS :=
|
||||||
|
LDFLAGS += -X main.GitCommit=${GIT_COMMIT}${GIT_DIRTY}
|
||||||
|
LDFLAGS += -X main.GitDescribe=${GIT_DESCRIBE}
|
||||||
|
|
||||||
|
GITHUB_TOKEN ?=
|
||||||
|
|
||||||
|
# Windows environment?
|
||||||
|
CYG_CHECK := $(shell hash cygpath 2>/dev/null && echo 1)
|
||||||
|
ifeq ($(CYG_CHECK),1)
|
||||||
|
VBOX_CHECK := $(shell hash VBoxManage 2>/dev/null && echo 1)
|
||||||
|
|
||||||
|
# Docker Toolbox (pre-Windows 10)
|
||||||
|
ifeq ($(VBOX_CHECK),1)
|
||||||
|
ROOT := /${PROJECT}
|
||||||
|
else
|
||||||
|
# Docker Windows
|
||||||
|
ROOT := $(shell cygpath -m -a "$(shell pwd)")
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
# all non-windows environments
|
||||||
|
ROOT := $(shell pwd)
|
||||||
|
endif
|
||||||
|
|
||||||
|
DEV_IMAGE := ${PROJECT}_dev
|
||||||
|
|
||||||
|
DOCKRUN := docker run --rm \
|
||||||
|
-e LDFLAGS="${LDFLAGS}" \
|
||||||
|
-e GITHUB_TOKEN="${GITHUB_TOKEN}" \
|
||||||
|
-v ${ROOT}/vendor:/go/src \
|
||||||
|
-v ${ROOT}:/${PROJECT}/src/${IMPORT_PATH} \
|
||||||
|
-w /${PROJECT}/src/${IMPORT_PATH} \
|
||||||
|
${DEV_IMAGE}
|
||||||
133
README.md
@@ -1,12 +1,85 @@
|
|||||||
# yaml [](https://travis-ci.org/mikefarah/yaml)
|
# yq
|
||||||
yaml is a lightweight and portable command-line YAML processor
|
|
||||||
|
[](https://travis-ci.org/mikefarah/yq)   
|
||||||
|
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
|
||||||
|
## Major upgrade - V3 beta is out!
|
||||||
|
|
||||||
|
This addresses a number of features requests and issues that have been raised :)
|
||||||
|
|
||||||
|
Currently only available only available as a [binary release here](https://github.com/mikefarah/yq/releases/tag/3.0.0-beta) or via docker mikefarah/yq:3.0.0-beta!
|
||||||
|
|
||||||
|
It does have a few breaking changes listed on the [release page](https://github.com/mikefarah/yq/releases/tag/3.0.0-beta)
|
||||||
|
|
||||||
|
Looking forward to feedback - once this is out of beta it will be added to the remaining package managers, and be the default version downloaded (and merged into master).
|
||||||
|
|
||||||
|
V2 will no longer have any new features added, and will be moved to a branch (v2). It will have limited maintenance for bugs for a few months.
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
[Download latest binary](https://github.com/mikefarah/yaml/releases/latest) or alternatively:
|
|
||||||
|
### On MacOS:
|
||||||
```
|
```
|
||||||
go get github.com/mikefarah/yaml
|
brew install yq
|
||||||
|
```
|
||||||
|
### On Ubuntu and other Linux distros supporting `snap` packages:
|
||||||
|
```
|
||||||
|
snap install yq
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Snap notes
|
||||||
|
`yq` installs with with [_strict confinement_](https://docs.snapcraft.io/snap-confinement/6233) in snap, this means it doesn't have direct access to root files. To read root files you can:
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo cat /etc/myfile | yq r - a.path
|
||||||
|
```
|
||||||
|
|
||||||
|
And to write to a root file you can either use [sponge](https://linux.die.net/man/1/sponge):
|
||||||
|
```
|
||||||
|
sudo cat /etc/myfile | yq w - a.path value | sudo sponge /etc/myfile
|
||||||
|
```
|
||||||
|
or write to a temporary file:
|
||||||
|
```
|
||||||
|
sudo cat /etc/myfile | yq w - a.path value | sudo tee /etc/myfile.tmp
|
||||||
|
sudo mv /etc/myfile.tmp /etc/myfile
|
||||||
|
rm /etc/myfile.tmp
|
||||||
|
```
|
||||||
|
|
||||||
|
### On Ubuntu 16.04 or higher from Debian package:
|
||||||
|
```
|
||||||
|
sudo add-apt-repository ppa:rmescandon/yq
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install yq -y
|
||||||
|
```
|
||||||
|
### or, [Download latest binary](https://github.com/mikefarah/yq/releases/latest) or alternatively:
|
||||||
|
```
|
||||||
|
GO111MODULE=on go get github.com/mikefarah/yq/v2
|
||||||
|
```
|
||||||
|
|
||||||
|
## Run with Docker
|
||||||
|
|
||||||
|
Oneshot use:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run --rm -v ${PWD}:/workdir mikefarah/yq yq [flags] <command> FILE...
|
||||||
|
```
|
||||||
|
|
||||||
|
Run commands interactively:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run --rm -it -v ${PWD}:/workdir mikefarah/yq sh
|
||||||
|
```
|
||||||
|
|
||||||
|
It can be useful to have a bash function to avoid typing the whole docker command:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yq() {
|
||||||
|
docker run --rm -i -v ${PWD}:/workdir mikefarah/yq yq $@
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
@@ -17,35 +90,55 @@ go get github.com/mikefarah/yaml
|
|||||||
- Update creates any missing entries in the path on the fly
|
- Update creates any missing entries in the path on the fly
|
||||||
- Create a yaml file given a deep path and value
|
- Create a yaml file given a deep path and value
|
||||||
- Create a yaml file given a script file
|
- Create a yaml file given a script file
|
||||||
|
- Prefix a path to a yaml file
|
||||||
- Convert from json to yaml
|
- Convert from json to yaml
|
||||||
- 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 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/yaml/)
|
## [Usage](http://mikefarah.github.io/yq/)
|
||||||
|
|
||||||
Check out the [documentation](http://mikefarah.github.io/yaml/) for more detailed and advanced usage.
|
Check out the [documentation](http://mikefarah.github.io/yq/) for more detailed and advanced usage.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
yq is a lightweight and portable command-line YAML processor. It aims to be the jq or sed of yaml files.
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
yaml [command]
|
yq [flags]
|
||||||
|
yq [command]
|
||||||
|
|
||||||
Available Commands:
|
Available Commands:
|
||||||
read yaml r sample.yaml a.b.c
|
delete yq d [--inplace/-i] [--doc/-d index] sample.yaml a.b.c
|
||||||
write yaml w [--inplace/-i] [--script/-s script_file] sample.yaml a.b.c newValueForC
|
help Help about any command
|
||||||
new yaml n [--script/-s script_file] a.b.c newValueForC
|
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 newValue
|
||||||
|
prefix yq p [--inplace/-i] [--doc/-d index] 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] [--doc/-d index] sample.yaml a.b.c newValue
|
||||||
|
|
||||||
Flags:
|
Flags:
|
||||||
-h, --help[=false]: help for yaml
|
-h, --help help for yq
|
||||||
-j, --tojson[=false]: output as json
|
-t, --trim trim yaml output (default true)
|
||||||
-t, --trim[=true]: trim yaml output
|
-v, --verbose verbose mode
|
||||||
-v, --verbose[=false]: verbose mode
|
-V, --version Print version information and quit
|
||||||
|
|
||||||
Use "yaml [command] --help" for more information about a command.
|
Use "yq [command] --help" for more information about a command.
|
||||||
```
|
```
|
||||||
|
|
||||||
## Contribute
|
## Contribute
|
||||||
1. run `govendor sync` [link](https://github.com/kardianos/govendor)
|
|
||||||
2. add unit tests
|
**Note: v3 is currently in progress - for the moment I won't be accepting new feature PRs until v3 is ready :)**
|
||||||
3. make changes
|
|
||||||
4. run ./precheckin.sh
|
1. `scripts/devtools.sh`
|
||||||
5. profit
|
2. `make [local] vendor`
|
||||||
|
3. add unit tests
|
||||||
|
4. apply changes to go.mod
|
||||||
|
5. `make [local] build`
|
||||||
|
6. If required, update the user documentation
|
||||||
|
- Update README.md and/or documentation under the mkdocs folder
|
||||||
|
- `make [local] build-docs`
|
||||||
|
- browse to docs/index.html and check your changes
|
||||||
|
7. profit
|
||||||
|
|||||||
15
ci.sh
@@ -1,15 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
go test
|
|
||||||
go build
|
|
||||||
|
|
||||||
# acceptance test
|
|
||||||
X=$(./yaml w sample.yaml b.c 3 | ./yaml r - b.c)
|
|
||||||
|
|
||||||
if [ $X != 3 ]
|
|
||||||
then
|
|
||||||
echo "Failed acceptance test: expected 2 but was $X"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
1286
commands_test.go
Normal file
@@ -1,3 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
go test -coverprofile=coverage.out && go tool cover -html=coverage.out
|
|
||||||
@@ -1,166 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"gopkg.in/yaml.v2"
|
|
||||||
"strconv"
|
|
||||||
)
|
|
||||||
|
|
||||||
func entryInSlice(context yaml.MapSlice, key interface{}) *yaml.MapItem {
|
|
||||||
for idx := range context {
|
|
||||||
var entry = &context[idx]
|
|
||||||
if entry.Key == key {
|
|
||||||
return entry
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func writeMap(context interface{}, paths []string, value interface{}) yaml.MapSlice {
|
|
||||||
log.Debugf("writeMap for %v for %v with value %v\n", paths, context, value)
|
|
||||||
|
|
||||||
var mapSlice yaml.MapSlice
|
|
||||||
switch context.(type) {
|
|
||||||
case yaml.MapSlice:
|
|
||||||
mapSlice = context.(yaml.MapSlice)
|
|
||||||
default:
|
|
||||||
mapSlice = make(yaml.MapSlice, 0)
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(paths) == 0 {
|
|
||||||
return mapSlice
|
|
||||||
}
|
|
||||||
|
|
||||||
child := entryInSlice(mapSlice, paths[0])
|
|
||||||
if child == nil {
|
|
||||||
newChild := yaml.MapItem{Key: paths[0]}
|
|
||||||
mapSlice = append(mapSlice, newChild)
|
|
||||||
child = entryInSlice(mapSlice, paths[0])
|
|
||||||
log.Debugf("\tAppended child at %v for mapSlice %v\n", paths[0], mapSlice)
|
|
||||||
}
|
|
||||||
|
|
||||||
log.Debugf("\tchild.Value %v\n", child.Value)
|
|
||||||
|
|
||||||
remainingPaths := paths[1:len(paths)]
|
|
||||||
child.Value = updatedChildValue(child.Value, remainingPaths, value)
|
|
||||||
log.Debugf("\tReturning mapSlice %v\n", mapSlice)
|
|
||||||
return mapSlice
|
|
||||||
}
|
|
||||||
|
|
||||||
func updatedChildValue(child interface{}, remainingPaths []string, value interface{}) interface{} {
|
|
||||||
if len(remainingPaths) == 0 {
|
|
||||||
return value
|
|
||||||
}
|
|
||||||
|
|
||||||
_, nextIndexErr := strconv.ParseInt(remainingPaths[0], 10, 64)
|
|
||||||
if nextIndexErr != nil {
|
|
||||||
// must be a map
|
|
||||||
return writeMap(child, remainingPaths, value)
|
|
||||||
}
|
|
||||||
|
|
||||||
// must be an array
|
|
||||||
return writeArray(child, remainingPaths, value)
|
|
||||||
}
|
|
||||||
|
|
||||||
func writeArray(context interface{}, paths []string, value interface{}) []interface{} {
|
|
||||||
log.Debugf("writeArray for %v for %v with value %v\n", paths, context, value)
|
|
||||||
var array []interface{}
|
|
||||||
switch context.(type) {
|
|
||||||
case []interface{}:
|
|
||||||
array = context.([]interface{})
|
|
||||||
default:
|
|
||||||
array = make([]interface{}, 1)
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(paths) == 0 {
|
|
||||||
return array
|
|
||||||
}
|
|
||||||
|
|
||||||
log.Debugf("\tarray %v\n", array)
|
|
||||||
|
|
||||||
rawIndex := paths[0]
|
|
||||||
index, err := strconv.ParseInt(rawIndex, 10, 64)
|
|
||||||
if err != nil {
|
|
||||||
die("Error accessing array: %v", err)
|
|
||||||
}
|
|
||||||
for index >= int64(len(array)) {
|
|
||||||
array = append(array, nil)
|
|
||||||
}
|
|
||||||
currentChild := array[index]
|
|
||||||
|
|
||||||
log.Debugf("\tcurrentChild %v\n", currentChild)
|
|
||||||
|
|
||||||
remainingPaths := paths[1:len(paths)]
|
|
||||||
array[index] = updatedChildValue(currentChild, remainingPaths, value)
|
|
||||||
log.Debugf("\tReturning array %v\n", array)
|
|
||||||
return array
|
|
||||||
}
|
|
||||||
|
|
||||||
func readMap(context yaml.MapSlice, head string, tail []string) interface{} {
|
|
||||||
if head == "*" {
|
|
||||||
return readMapSplat(context, tail)
|
|
||||||
}
|
|
||||||
var value interface{}
|
|
||||||
|
|
||||||
entry := entryInSlice(context, head)
|
|
||||||
if entry != nil {
|
|
||||||
value = entry.Value
|
|
||||||
}
|
|
||||||
return calculateValue(value, tail)
|
|
||||||
}
|
|
||||||
|
|
||||||
func readMapSplat(context yaml.MapSlice, tail []string) interface{} {
|
|
||||||
var newArray = make([]interface{}, len(context))
|
|
||||||
var i = 0
|
|
||||||
for _, entry := range context {
|
|
||||||
if len(tail) > 0 {
|
|
||||||
newArray[i] = recurse(entry.Value, tail[0], tail[1:len(tail)])
|
|
||||||
} else {
|
|
||||||
newArray[i] = entry.Value
|
|
||||||
}
|
|
||||||
i++
|
|
||||||
}
|
|
||||||
return newArray
|
|
||||||
}
|
|
||||||
|
|
||||||
func recurse(value interface{}, head string, tail []string) interface{} {
|
|
||||||
switch value.(type) {
|
|
||||||
case []interface{}:
|
|
||||||
if head == "*" {
|
|
||||||
return readArraySplat(value.([]interface{}), tail)
|
|
||||||
}
|
|
||||||
index, err := strconv.ParseInt(head, 10, 64)
|
|
||||||
if err != nil {
|
|
||||||
die("Error accessing array: %v", err)
|
|
||||||
}
|
|
||||||
return readArray(value.([]interface{}), index, tail)
|
|
||||||
case yaml.MapSlice:
|
|
||||||
return readMap(value.(yaml.MapSlice), head, tail)
|
|
||||||
default:
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func readArray(array []interface{}, head int64, tail []string) interface{} {
|
|
||||||
if head >= int64(len(array)) {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
value := array[head]
|
|
||||||
|
|
||||||
return calculateValue(value, tail)
|
|
||||||
}
|
|
||||||
|
|
||||||
func readArraySplat(array []interface{}, tail []string) interface{} {
|
|
||||||
var newArray = make([]interface{}, len(array))
|
|
||||||
for index, value := range array {
|
|
||||||
newArray[index] = calculateValue(value, tail)
|
|
||||||
}
|
|
||||||
return newArray
|
|
||||||
}
|
|
||||||
|
|
||||||
func calculateValue(value interface{}, tail []string) interface{} {
|
|
||||||
if len(tail) > 0 {
|
|
||||||
return recurse(value, tail[0], tail[1:len(tail)])
|
|
||||||
}
|
|
||||||
return value
|
|
||||||
}
|
|
||||||
@@ -1,248 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"github.com/op/go-logging"
|
|
||||||
"gopkg.in/yaml.v2"
|
|
||||||
"os"
|
|
||||||
"sort"
|
|
||||||
"testing"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestMain(m *testing.M) {
|
|
||||||
backend.SetLevel(logging.ERROR, "")
|
|
||||||
logging.SetBackend(backend)
|
|
||||||
os.Exit(m.Run())
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestReadMap_simple(t *testing.T) {
|
|
||||||
var data = parseData(`
|
|
||||||
---
|
|
||||||
b:
|
|
||||||
c: 2
|
|
||||||
`)
|
|
||||||
assertResult(t, 2, readMap(data, "b", []string{"c"}))
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestReadMap_splat(t *testing.T) {
|
|
||||||
var data = parseData(`
|
|
||||||
---
|
|
||||||
mapSplat:
|
|
||||||
item1: things
|
|
||||||
item2: whatever
|
|
||||||
`)
|
|
||||||
var result = readMap(data, "mapSplat", []string{"*"}).([]interface{})
|
|
||||||
var actual = []string{result[0].(string), result[1].(string)}
|
|
||||||
sort.Strings(actual)
|
|
||||||
assertResult(t, "[things whatever]", fmt.Sprintf("%v", actual))
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestReadMap_deep_splat(t *testing.T) {
|
|
||||||
var data = parseData(`
|
|
||||||
---
|
|
||||||
mapSplatDeep:
|
|
||||||
item1:
|
|
||||||
cats: bananas
|
|
||||||
item2:
|
|
||||||
cats: apples
|
|
||||||
`)
|
|
||||||
|
|
||||||
var result = readMap(data, "mapSplatDeep", []string{"*", "cats"}).([]interface{})
|
|
||||||
var actual = []string{result[0].(string), result[1].(string)}
|
|
||||||
sort.Strings(actual)
|
|
||||||
assertResult(t, "[apples bananas]", fmt.Sprintf("%v", actual))
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestReadMap_key_doesnt_exist(t *testing.T) {
|
|
||||||
var data = parseData(`
|
|
||||||
---
|
|
||||||
b:
|
|
||||||
c: 2
|
|
||||||
`)
|
|
||||||
assertResult(t, nil, readMap(data, "b.x.f", []string{"c"}))
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestReadMap_recurse_against_string(t *testing.T) {
|
|
||||||
var data = parseData(`
|
|
||||||
---
|
|
||||||
a: cat
|
|
||||||
`)
|
|
||||||
assertResult(t, nil, readMap(data, "a", []string{"b"}))
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestReadMap_with_array(t *testing.T) {
|
|
||||||
var data = parseData(`
|
|
||||||
---
|
|
||||||
b:
|
|
||||||
d:
|
|
||||||
- 3
|
|
||||||
- 4
|
|
||||||
`)
|
|
||||||
assertResult(t, 4, readMap(data, "b", []string{"d", "1"}))
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestReadMap_with_array_out_of_bounds(t *testing.T) {
|
|
||||||
var data = parseData(`
|
|
||||||
---
|
|
||||||
b:
|
|
||||||
d:
|
|
||||||
- 3
|
|
||||||
- 4
|
|
||||||
`)
|
|
||||||
assertResult(t, nil, readMap(data, "b", []string{"d", "3"}))
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestReadMap_with_array_out_of_bounds_by_1(t *testing.T) {
|
|
||||||
var data = parseData(`
|
|
||||||
---
|
|
||||||
b:
|
|
||||||
d:
|
|
||||||
- 3
|
|
||||||
- 4
|
|
||||||
`)
|
|
||||||
assertResult(t, nil, readMap(data, "b", []string{"d", "2"}))
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestReadMap_with_array_splat(t *testing.T) {
|
|
||||||
var data = parseData(`
|
|
||||||
e:
|
|
||||||
-
|
|
||||||
name: Fred
|
|
||||||
thing: cat
|
|
||||||
-
|
|
||||||
name: Sam
|
|
||||||
thing: dog
|
|
||||||
`)
|
|
||||||
assertResult(t, "[Fred Sam]", fmt.Sprintf("%v", readMap(data, "e", []string{"*", "name"})))
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestWrite_really_simple(t *testing.T) {
|
|
||||||
var data = parseData(`
|
|
||||||
b: 2
|
|
||||||
`)
|
|
||||||
|
|
||||||
updated := writeMap(data, []string{"b"}, "4")
|
|
||||||
b := entryInSlice(updated, "b").Value
|
|
||||||
assertResult(t, "4", b)
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestWrite_simple(t *testing.T) {
|
|
||||||
var data = parseData(`
|
|
||||||
b:
|
|
||||||
c: 2
|
|
||||||
`)
|
|
||||||
|
|
||||||
updated := writeMap(data, []string{"b", "c"}, "4")
|
|
||||||
b := entryInSlice(updated, "b").Value.(yaml.MapSlice)
|
|
||||||
c := entryInSlice(b, "c").Value
|
|
||||||
assertResult(t, "4", c)
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestWrite_new(t *testing.T) {
|
|
||||||
var data = parseData(`
|
|
||||||
b:
|
|
||||||
c: 2
|
|
||||||
`)
|
|
||||||
|
|
||||||
updated := writeMap(data, []string{"b", "d"}, "4")
|
|
||||||
b := entryInSlice(updated, "b").Value.(yaml.MapSlice)
|
|
||||||
d := entryInSlice(b, "d").Value
|
|
||||||
assertResult(t, "4", d)
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestWrite_new_deep(t *testing.T) {
|
|
||||||
var data = parseData(`
|
|
||||||
b:
|
|
||||||
c: 2
|
|
||||||
`)
|
|
||||||
|
|
||||||
updated := writeMap(data, []string{"b", "d", "f"}, "4")
|
|
||||||
assertResult(t, "4", readMap(updated, "b", []string{"d", "f"}))
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestWrite_array(t *testing.T) {
|
|
||||||
var data = parseData(`
|
|
||||||
b:
|
|
||||||
- aa
|
|
||||||
`)
|
|
||||||
|
|
||||||
updated := writeMap(data, []string{"b", "0"}, "bb")
|
|
||||||
|
|
||||||
b := entryInSlice(updated, "b").Value.([]interface{})
|
|
||||||
assertResult(t, "bb", b[0].(string))
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestWrite_new_array(t *testing.T) {
|
|
||||||
var data = parseData(`
|
|
||||||
b:
|
|
||||||
c: 2
|
|
||||||
`)
|
|
||||||
|
|
||||||
updated := writeMap(data, []string{"b", "0"}, "4")
|
|
||||||
assertResult(t, "4", readMap(updated, "b", []string{"0"}))
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestWrite_new_array_deep(t *testing.T) {
|
|
||||||
var data = parseData(`
|
|
||||||
b:
|
|
||||||
c: 2
|
|
||||||
`)
|
|
||||||
|
|
||||||
var expected = `b:
|
|
||||||
- c: "4"`
|
|
||||||
|
|
||||||
updated := writeMap(data, []string{"b", "0", "c"}, "4")
|
|
||||||
assertResult(t, expected, yamlToString(updated))
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestWrite_new_map_array_deep(t *testing.T) {
|
|
||||||
var data = parseData(`
|
|
||||||
b:
|
|
||||||
c: 2
|
|
||||||
`)
|
|
||||||
|
|
||||||
updated := writeMap(data, []string{"b", "d", "0"}, "4")
|
|
||||||
assertResult(t, "4", readMap(updated, "b", []string{"d", "0"}))
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestWrite_add_to_array(t *testing.T) {
|
|
||||||
var data = parseData(`
|
|
||||||
b:
|
|
||||||
- aa
|
|
||||||
`)
|
|
||||||
|
|
||||||
var expected = `b:
|
|
||||||
- aa
|
|
||||||
- bb`
|
|
||||||
|
|
||||||
updated := writeMap(data, []string{"b", "1"}, "bb")
|
|
||||||
|
|
||||||
assertResult(t, expected, yamlToString(updated))
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestWrite_with_no_tail(t *testing.T) {
|
|
||||||
var data = parseData(`
|
|
||||||
b:
|
|
||||||
c: 2
|
|
||||||
`)
|
|
||||||
updated := writeMap(data, []string{"b"}, "4")
|
|
||||||
|
|
||||||
b := entryInSlice(updated, "b").Value
|
|
||||||
assertResult(t, "4", fmt.Sprintf("%v", b))
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestWriteMap_no_paths(t *testing.T) {
|
|
||||||
var data = parseData(`
|
|
||||||
b: 5
|
|
||||||
`)
|
|
||||||
|
|
||||||
result := writeMap(data, []string{}, 4)
|
|
||||||
assertResult(t, fmt.Sprintf("%v", data), fmt.Sprintf("%v", result))
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestWriteArray_no_paths(t *testing.T) {
|
|
||||||
var data = make([]interface{}, 1)
|
|
||||||
data[0] = "mike"
|
|
||||||
result := writeArray(data, []string{}, 4)
|
|
||||||
assertResult(t, fmt.Sprintf("%v", data), fmt.Sprintf("%v", result))
|
|
||||||
}
|
|
||||||
31
debian/changelog
vendored
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
yq (2.2-1) bionic; urgency=medium
|
||||||
|
|
||||||
|
* Added Windows support for the "--inplace" command flag
|
||||||
|
* Prefix now supports arrays
|
||||||
|
* Add prefix command
|
||||||
|
* Bump Alpine version to 3.8
|
||||||
|
* Improved docker build process
|
||||||
|
* Lint fixes
|
||||||
|
* Build support for all linux architectures supported by gox
|
||||||
|
|
||||||
|
-- Roberto Mier Escandon <rmescandon@gmail.com> Sat, 19 Jan 2019 15:50:47 +0100
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
* Release 1.15
|
||||||
|
|
||||||
|
-- Roberto Mier Escandón <rmescandon@gmail.com> Wed, 06 Jun 2018 11:32:03 +0200
|
||||||
|
|
||||||
1
debian/compat
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
9
|
||||||
22
debian/control
vendored
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
Source: yq
|
||||||
|
Section: devel
|
||||||
|
Priority: extra
|
||||||
|
Maintainer: Roberto Mier Escandón <rmescandon@gmail.com>
|
||||||
|
Build-Depends: debhelper (>= 9),
|
||||||
|
dh-golang,
|
||||||
|
golang-1.10-go,
|
||||||
|
rsync
|
||||||
|
Standards-Version: 3.9.6
|
||||||
|
Homepage: https://github.com/mikefarah/yq.git
|
||||||
|
Vcs-Browser: https://github.com/mikefarah/yq.git
|
||||||
|
Vcs-Git: https://github.com/mikefarah/yq.git
|
||||||
|
|
||||||
|
Package: yq
|
||||||
|
Architecture: any
|
||||||
|
Built-Using: ${misc:Built-Using}
|
||||||
|
Depends: ${shlibs:Depends},
|
||||||
|
${misc:Depends}
|
||||||
|
Description:
|
||||||
|
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.
|
||||||
7
debian/copyright
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||||
|
Upstream-Name: yq
|
||||||
|
Source: https://github.com/mikefarah/yq.git
|
||||||
|
|
||||||
|
Files: *
|
||||||
|
Copyright: 2017 Mike Farah Ltd. All rights reserved
|
||||||
|
License: Proprietary
|
||||||
2
debian/gbp.conf
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
[DEFAULT]
|
||||||
|
pristine-tar = True
|
||||||
59
debian/rules
vendored
Executable file
@@ -0,0 +1,59 @@
|
|||||||
|
#!/usr/bin/make -f
|
||||||
|
#
|
||||||
|
# Copyright (C) 2018 Roberto Mier Escandón <rmescandon@gmail.com>
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License version 3 as
|
||||||
|
# published by the Free Software Foundation.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
|
PROJECT := yq
|
||||||
|
OWNER := mikefarah
|
||||||
|
REPO := github.com
|
||||||
|
GOVERSION := 1.10
|
||||||
|
export DH_OPTIONS
|
||||||
|
export DH_GOPKG := ${REPO}/${OWNER}/${PROJECT}
|
||||||
|
export GOROOT := /usr/lib/go-${GOVERSION}
|
||||||
|
export GOPATH := ${CURDIR}/_build
|
||||||
|
export GOBIN := ${GOPATH}/bin
|
||||||
|
export PATH := ${GOROOT}/bin:${GOBIN}:${PATH}
|
||||||
|
BLDPATH := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
|
||||||
|
SRCDIR := ${CURDIR}/_build/src/${DH_GOPKG}
|
||||||
|
DESTDIR := ${CURDIR}/debian/${PROJECT}
|
||||||
|
BINDIR := /usr/bin
|
||||||
|
ASSETSDIR := /usr/share/${PROJECT}
|
||||||
|
|
||||||
|
%:
|
||||||
|
dh $@ --buildsystem=golang --with=golang
|
||||||
|
|
||||||
|
override_dh_auto_build:
|
||||||
|
mkdir -p ${SRCDIR}
|
||||||
|
mkdir -p ${GOBIN}
|
||||||
|
# copy project to local srcdir to build from there
|
||||||
|
rsync -avz --progress --exclude=obj-${BLDPATH} --exclude=debian . $(SRCDIR)
|
||||||
|
# build go code
|
||||||
|
(cd ${SRCDIR} && go install ./...)
|
||||||
|
|
||||||
|
override_dh_auto_test:
|
||||||
|
(cd ${SRCDIR} && go test -v ./...)
|
||||||
|
|
||||||
|
override_dh_auto_install:
|
||||||
|
mkdir -p ${DESTDIR}/${BINDIR}
|
||||||
|
mkdir -p ${DESTDIR}/${ASSETSDIR}
|
||||||
|
cp ${CURDIR}/_build/bin/yq ${DESTDIR}/${BINDIR}
|
||||||
|
cp -rf ${SRCDIR}/LICENSE ${DESTDIR}/${ASSETSDIR}
|
||||||
|
cp -rf ${SRCDIR}/README.md ${DESTDIR}/${PLUGINSDIR}
|
||||||
|
chmod a+x ${DESTDIR}/${BINDIR}/yq
|
||||||
|
|
||||||
|
override_dh_auto_clean:
|
||||||
|
dh_clean
|
||||||
|
rm -rf ${CURDIR}/obj-${BLDPATH}
|
||||||
|
rm -rf ${CURDIR}/_build
|
||||||
1
debian/source/format
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
3.0 (native)
|
||||||
249
docs/404.html
@@ -1,97 +1,143 @@
|
|||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html class="no-js">
|
|
||||||
|
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en" class="no-js">
|
||||||
<head>
|
<head>
|
||||||
|
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
|
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="shortcut icon" href="/assets/images/favicon.png">
|
<meta name="lang:clipboard.copy" content="Copy to clipboard">
|
||||||
|
|
||||||
<meta name="generator" content="mkdocs-0.16.3, mkdocs-material-1.5.4">
|
<meta name="lang:clipboard.copied" content="Copied to clipboard">
|
||||||
|
|
||||||
|
<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.one" content="1 matching document">
|
||||||
|
|
||||||
|
<meta name="lang:search.result.other" content="# matching documents">
|
||||||
|
|
||||||
|
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||||
|
|
||||||
|
<link rel="shortcut icon" href="/assets/images/favicon.png">
|
||||||
|
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.2.0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<title>Yaml</title>
|
<title>Yq</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script src="/assets/javascripts/modernizr-56ade86843.js"></script>
|
<link rel="stylesheet" href="/assets/stylesheets/application.750b69bd.css">
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="/assets/stylesheets/application-b1a1975878.css">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<script src="/assets/javascripts/modernizr.74668098.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 dir="ltr">
|
||||||
|
|
||||||
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<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">
|
||||||
<div class="md-flex">
|
<div class="md-flex">
|
||||||
<div class="md-flex__cell md-flex__cell--shrink">
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
<a href="/." title="Yq" class="md-header-nav__button md-logo">
|
||||||
<a href="/" title="Yaml" class="md-icon md-icon--home md-header-nav__button">
|
|
||||||
</a>
|
<i class="md-icon"></i>
|
||||||
|
|
||||||
|
</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">
|
||||||
<span class="md-flex__ellipsis md-header-nav__title">
|
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
||||||
|
|
||||||
|
<span class="md-header-nav__topic">
|
||||||
Yaml
|
Yq
|
||||||
|
</span>
|
||||||
|
<span class="md-header-nav__topic">
|
||||||
|
|
||||||
|
</span>
|
||||||
|
|
||||||
</span>
|
</div>
|
||||||
</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--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">
|
<div class="md-search" data-md-component="search" role="dialog">
|
||||||
<div class="md-search__overlay"></div>
|
<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" accesskey="s" 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">close</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>
|
||||||
<div class="md-search-result" data-md-component="result">
|
<div class="md-search-result" data-md-component="result">
|
||||||
<div class="md-search-result__meta" data-md-lang-result-none="No matching documents" data-md-lang-result-one="1 matching document" data-md-lang-result-other="# matching documents">
|
<div class="md-search-result__meta">
|
||||||
Type to start searching
|
Type to start searching
|
||||||
</div>
|
</div>
|
||||||
<ol class="md-search-result__list"></ol>
|
<ol class="md-search-result__list"></ol>
|
||||||
@@ -102,37 +148,37 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="md-flex__cell md-flex__cell--shrink">
|
|
||||||
<div class="md-header-nav__source">
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
<div class="md-header-nav__source">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://github.com/mikefarah/yq/" title="Go to repository" class="md-source" data-md-source="github">
|
||||||
<a href="https://github.com/mikefarah/yaml" title="Go to repository" class="md-source" data-md-source="github">
|
|
||||||
|
<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 class="md-source__repository">
|
|
||||||
mikefarah/yaml
|
|
||||||
</div>
|
</div>
|
||||||
</a>
|
|
||||||
|
<div class="md-source__repository">
|
||||||
|
mikefarah/yq
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div class="md-container">
|
<div class="md-container">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<main class="md-main">
|
<main class="md-main">
|
||||||
<div class="md-main__inner md-grid" data-md-component="container">
|
<div class="md-main__inner md-grid" data-md-component="container">
|
||||||
@@ -142,11 +188,13 @@
|
|||||||
<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">
|
||||||
|
<a href="/." title="Yq" class="md-nav__button md-logo">
|
||||||
<i class="md-icon md-icon--home md-nav__button"></i>
|
|
||||||
|
<i class="md-icon"></i>
|
||||||
Yaml
|
|
||||||
|
</a>
|
||||||
|
Yq
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<div class="md-nav__source">
|
<div class="md-nav__source">
|
||||||
@@ -155,20 +203,18 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://github.com/mikefarah/yq/" title="Go to repository" class="md-source" data-md-source="github">
|
||||||
<a href="https://github.com/mikefarah/yaml" title="Go to repository" class="md-source" data-md-source="github">
|
|
||||||
|
<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 class="md-source__repository">
|
|
||||||
mikefarah/yaml
|
|
||||||
</div>
|
</div>
|
||||||
</a>
|
|
||||||
|
<div class="md-source__repository">
|
||||||
|
mikefarah/yq
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ul class="md-nav__list" data-md-scrollfix>
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
@@ -179,7 +225,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<li class="md-nav__item">
|
<li class="md-nav__item">
|
||||||
<a href="/" title="Install" class="md-nav__link">
|
<a href="/." title="Install" class="md-nav__link">
|
||||||
Install
|
Install
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@@ -214,6 +260,30 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="/prefix/" title="Prefix" class="md-nav__link">
|
||||||
|
Prefix
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="/delete/" title="Delete" class="md-nav__link">
|
||||||
|
Delete
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<li class="md-nav__item">
|
<li class="md-nav__item">
|
||||||
<a href="/create/" title="Create" class="md-nav__link">
|
<a href="/create/" title="Create" class="md-nav__link">
|
||||||
Create
|
Create
|
||||||
@@ -233,6 +303,18 @@
|
|||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="/merge/" title="Merge" class="md-nav__link">
|
||||||
|
Merge
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
@@ -248,6 +330,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
@@ -262,16 +346,14 @@
|
|||||||
<div class="md-footer-copyright">
|
<div class="md-footer-copyright">
|
||||||
|
|
||||||
powered by
|
powered by
|
||||||
<a href="http://www.mkdocs.org" title="MkDocs">MkDocs</a>
|
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||||
and
|
and
|
||||||
<a href="http://squidfunk.github.io/mkdocs-material/" title="Material for MkDocs">
|
<a href="https://squidfunk.github.io/mkdocs-material/">
|
||||||
Material for MkDocs</a>
|
Material for MkDocs</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<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>
|
||||||
|
|
||||||
@@ -279,18 +361,15 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/assets/javascripts/application-0b7df094bf.js"></script>
|
<script src="/assets/javascripts/application.39abc4af.js"></script>
|
||||||
<script>app.initialize({url:{base:""}})</script>
|
|
||||||
|
|
||||||
|
<script>app.initialize({version:"1.0.4",url:{base:"/"}})</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
4
docs/assets/fonts/font-awesome.css
vendored
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.woff
Normal file
BIN
docs/assets/fonts/specimen/FontAwesome.woff2
Normal file
BIN
docs/assets/fonts/specimen/MaterialIcons-Regular.ttf
Normal file
BIN
docs/assets/fonts/specimen/MaterialIcons-Regular.woff
Normal file
BIN
docs/assets/fonts/specimen/MaterialIcons-Regular.woff2
Normal file
|
Before Width: | Height: | Size: 1.1 KiB |
BIN
docs/assets/images/favicon.png
Normal file
|
After Width: | Height: | Size: 521 B |
@@ -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 |
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="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
@@ -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 |
@@ -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 |
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 |
6
docs/assets/javascripts/application.39abc4af.js
Normal file
1
docs/assets/javascripts/lunr/lunr.da.js
Normal file
@@ -0,0 +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,m,i;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,m=e.stemmerSupport.SnowballProgram,i=new function(){var i,t,n,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 m;function l(){var e,r=c.limit-c.cursor;c.cursor>=t&&(e=c.limit_backward,c.limit_backward=t,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 e,r=c.cursor;return function(){var e,r=c.cursor+3;if(t=c.limit,0<=r&&r<=c.limit){for(i=r;;){if(e=c.cursor,c.in_grouping(d,97,248)){c.cursor=e;break}if((c.cursor=e)>=c.limit)return;c.cursor++}for(;!c.out_grouping(d,97,248);){if(c.cursor>=c.limit)return;c.cursor++}(t=c.cursor)<i&&(t=i)}}(),c.limit_backward=r,c.cursor=c.limit,function(){var e,r;if(c.cursor>=t&&(r=c.limit_backward,c.limit_backward=t,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,n=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-n,c.cursor>=t&&(r=c.limit_backward,c.limit_backward=t,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>=t&&(e=c.limit_backward,c.limit_backward=t,c.ket=c.cursor,c.out_grouping_b(d,97,248)?(c.bra=c.cursor,n=c.slice_to(n),c.limit_backward=e,c.eq_v_b(n)&&c.slice_del()):c.limit_backward=e),!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.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")}});
|
||||||
1
docs/assets/javascripts/lunr/lunr.de.js
Normal file
1
docs/assets/javascripts/lunr/lunr.du.js
Normal file
1
docs/assets/javascripts/lunr/lunr.es.js
Normal file
1
docs/assets/javascripts/lunr/lunr.fi.js
Normal file
1
docs/assets/javascripts/lunr/lunr.fr.js
Normal file
1
docs/assets/javascripts/lunr/lunr.hu.js
Normal file
1
docs/assets/javascripts/lunr/lunr.it.js
Normal file
1
docs/assets/javascripts/lunr/lunr.ja.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(m){if(void 0===m)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===m.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var l="2"==m.version[0];m.ja=function(){this.pipeline.reset(),this.pipeline.add(m.ja.trimmer,m.ja.stopWordFilter,m.ja.stemmer),l?this.tokenizer=m.ja.tokenizer:(m.tokenizer&&(m.tokenizer=m.ja.tokenizer),this.tokenizerFn&&(this.tokenizerFn=m.ja.tokenizer))};var j=new m.TinySegmenter;m.ja.tokenizer=function(e){var r,t,i,n,o,s,p,a,u;if(!arguments.length||null==e||null==e)return[];if(Array.isArray(e))return e.map(function(e){return l?new m.Token(e.toLowerCase()):e.toLowerCase()});for(r=(t=e.toString().toLowerCase().replace(/^\s+/,"")).length-1;0<=r;r--)if(/\S/.test(t.charAt(r))){t=t.substring(0,r+1);break}for(o=[],i=t.length,p=a=0;a<=i;a++)if(s=a-p,t.charAt(a).match(/\s/)||a==i){if(0<s)for(n=j.segment(t.slice(p,a)).filter(function(e){return!!e}),u=p,r=0;r<n.length;r++)l?o.push(new m.Token(n[r],{position:[u,n[r].length],index:o.length})):o.push(n[r]),u+=n[r].length;p=a+1}return o},m.ja.stemmer=function(e){return e},m.Pipeline.registerFunction(m.ja.stemmer,"stemmer-ja"),m.ja.wordCharacters="一二三四五六七八九十百千万億兆一-龠々〆ヵヶぁ-んァ-ヴーア-ン゙a-zA-Za-zA-Z0-90-9",m.ja.trimmer=m.trimmerSupport.generateTrimmer(m.ja.wordCharacters),m.Pipeline.registerFunction(m.ja.trimmer,"trimmer-ja"),m.ja.stopWordFilter=m.generateStopWordFilter("これ それ あれ この その あの ここ そこ あそこ こちら どこ だれ なに なん 何 私 貴方 貴方方 我々 私達 あの人 あのかた 彼女 彼 です あります おります います は が の に を で え から まで より も どの と し それで しかし".split(" ")),m.Pipeline.registerFunction(m.ja.stopWordFilter,"stopWordFilter-ja"),m.jp=m.ja,m.Pipeline.registerFunction(m.jp.stemmer,"stemmer-jp"),m.Pipeline.registerFunction(m.jp.trimmer,"trimmer-jp"),m.Pipeline.registerFunction(m.jp.stopWordFilter,"stopWordFilter-jp")}});
|
||||||
1
docs/assets/javascripts/lunr/lunr.jp.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
module.exports=require("./lunr.ja");
|
||||||
1
docs/assets/javascripts/lunr/lunr.multi.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
!function(e,i){"function"==typeof define&&define.amd?define(i):"object"==typeof exports?module.exports=i():i()(e.lunr)}(this,function(){return function(o){o.multiLanguage=function(){for(var e=Array.prototype.slice.call(arguments),i=e.join("-"),t="",r=[],n=[],s=0;s<e.length;++s)"en"==e[s]?(t+="\\w",r.unshift(o.stopWordFilter),r.push(o.stemmer),n.push(o.stemmer)):(t+=o[e[s]].wordCharacters,r.unshift(o[e[s]].stopWordFilter),r.push(o[e[s]].stemmer),n.push(o[e[s]].stemmer));var p=o.trimmerSupport.generateTrimmer(t);return o.Pipeline.registerFunction(p,"lunr-multi-trimmer-"+i),r.unshift(p),function(){this.pipeline.reset(),this.pipeline.add.apply(this.pipeline,r),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add.apply(this.searchPipeline,n))}}}});
|
||||||
1
docs/assets/javascripts/lunr/lunr.nl.js
Normal file
1
docs/assets/javascripts/lunr/lunr.no.js
Normal file
@@ -0,0 +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,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 o,s,a=[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)],m=[new r("dt",-1,-1),new r("vt",-1,-1)],l=[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)],u=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,48,0,128],d=[119,125,149,1],c=new n;this.setCurrent=function(e){c.setCurrent(e)},this.getCurrent=function(){return c.getCurrent()},this.stem=function(){var e,r,n,i,t=c.cursor;return function(){var e,r=c.cursor+3;if(s=c.limit,0<=r||r<=c.limit){for(o=r;;){if(e=c.cursor,c.in_grouping(u,97,248)){c.cursor=e;break}if(e>=c.limit)return;c.cursor=e+1}for(;!c.out_grouping(u,97,248);){if(c.cursor>=c.limit)return;c.cursor++}(s=c.cursor)<o&&(s=o)}}(),c.limit_backward=t,c.cursor=c.limit,function(){var e,r,n;if(c.cursor>=s&&(r=c.limit_backward,c.limit_backward=s,c.ket=c.cursor,e=c.find_among_b(a,29),c.limit_backward=r,e))switch(c.bra=c.cursor,e){case 1:c.slice_del();break;case 2:n=c.limit-c.cursor,c.in_grouping_b(d,98,122)?c.slice_del():(c.cursor=c.limit-n,c.eq_s_b(1,"k")&&c.out_grouping_b(u,97,248)&&c.slice_del());break;case 3:c.slice_from("er")}}(),c.cursor=c.limit,r=c.limit-c.cursor,c.cursor>=s&&(e=c.limit_backward,c.limit_backward=s,c.ket=c.cursor,c.find_among_b(m,2)?(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),c.cursor=c.limit,c.cursor>=s&&(i=c.limit_backward,c.limit_backward=s,c.ket=c.cursor,(n=c.find_among_b(l,11))?(c.bra=c.cursor,c.limit_backward=i,1==n&&c.slice_del()):c.limit_backward=i),!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")}});
|
||||||
1
docs/assets/javascripts/lunr/lunr.pt.js
Normal file
1
docs/assets/javascripts/lunr/lunr.ro.js
Normal file
1
docs/assets/javascripts/lunr/lunr.ru.js
Normal file
1
docs/assets/javascripts/lunr/lunr.stemmer.support.js
Normal file
@@ -0,0 +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 b;return{bra:0,ket:0,limit:0,cursor:0,limit_backward:0,setCurrent:function(r){b=r,this.cursor=0,this.limit=r.length,this.limit_backward=0,this.bra=this.cursor,this.ket=this.limit},getCurrent:function(){var r=b;return b=null,r},in_grouping:function(r,t,i){if(this.cursor<this.limit){var s=b.charCodeAt(this.cursor);if(s<=i&&t<=s&&r[(s-=t)>>3]&1<<(7&s))return this.cursor++,!0}return!1},in_grouping_b:function(r,t,i){if(this.cursor>this.limit_backward){var s=b.charCodeAt(this.cursor-1);if(s<=i&&t<=s&&r[(s-=t)>>3]&1<<(7&s))return this.cursor--,!0}return!1},out_grouping:function(r,t,i){if(this.cursor<this.limit){var s=b.charCodeAt(this.cursor);if(i<s||s<t)return this.cursor++,!0;if(!(r[(s-=t)>>3]&1<<(7&s)))return this.cursor++,!0}return!1},out_grouping_b:function(r,t,i){if(this.cursor>this.limit_backward){var s=b.charCodeAt(this.cursor-1);if(i<s||s<t)return this.cursor--,!0;if(!(r[(s-=t)>>3]&1<<(7&s)))return this.cursor--,!0}return!1},eq_s:function(r,t){if(this.limit-this.cursor<r)return!1;for(var i=0;i<r;i++)if(b.charCodeAt(this.cursor+i)!=t.charCodeAt(i))return!1;return this.cursor+=r,!0},eq_s_b:function(r,t){if(this.cursor-this.limit_backward<r)return!1;for(var i=0;i<r;i++)if(b.charCodeAt(this.cursor-r+i)!=t.charCodeAt(i))return!1;return this.cursor-=r,!0},find_among:function(r,t){for(var i=0,s=t,e=this.cursor,n=this.limit,u=0,o=0,h=!1;;){for(var c=i+(s-i>>1),a=0,f=u<o?u:o,l=r[c],_=f;_<l.s_size;_++){if(e+f==n){a=-1;break}if(a=b.charCodeAt(e+f)-l.s[_])break;f++}if(a<0?(s=c,o=f):(i=c,u=f),s-i<=1){if(0<i||s==i||h)break;h=!0}}for(;;){if(u>=(l=r[i]).s_size){if(this.cursor=e+l.s_size,!l.method)return l.result;var m=l.method();if(this.cursor=e+l.s_size,m)return l.result}if((i=l.substring_i)<0)return 0}},find_among_b:function(r,t){for(var i=0,s=t,e=this.cursor,n=this.limit_backward,u=0,o=0,h=!1;;){for(var c=i+(s-i>>1),a=0,f=u<o?u:o,l=(_=r[c]).s_size-1-f;0<=l;l--){if(e-f==n){a=-1;break}if(a=b.charCodeAt(e-1-f)-_.s[l])break;f++}if(a<0?(s=c,o=f):(i=c,u=f),s-i<=1){if(0<i||s==i||h)break;h=!0}}for(;;){var _;if(u>=(_=r[i]).s_size){if(this.cursor=e-_.s_size,!_.method)return _.result;var m=_.method();if(this.cursor=e-_.s_size,m)return _.result}if((i=_.substring_i)<0)return 0}},replace_s:function(r,t,i){var s=i.length-(t-r);return b=b.substring(0,r)+i+b.substring(t),this.limit+=s,this.cursor>=t?this.cursor+=s:this.cursor>r&&(this.cursor=r),s},slice_check:function(){if(this.bra<0||this.bra>this.ket||this.ket>this.limit||this.limit>b.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(),b.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
docs/assets/javascripts/lunr/lunr.sv.js
Normal file
@@ -0,0 +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,l,n;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,l=e.stemmerSupport.SnowballProgram,n=new function(){var n,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 l;this.setCurrent=function(e){m.setCurrent(e)},this.getCurrent=function(){return m.getCurrent()},this.stem=function(){var e,r=m.cursor;return function(){var e,r=m.cursor+3;if(t=m.limit,0<=r||r<=m.limit){for(n=r;;){if(e=m.cursor,m.in_grouping(o,97,246)){m.cursor=e;break}if(m.cursor=e,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)<n&&(t=n)}}(),m.limit_backward=r,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,e=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=e),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 n.setCurrent(e),n.stem(),n.getCurrent()}):(n.setCurrent(e),n.stem(),n.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")}});
|
||||||
1
docs/assets/javascripts/lunr/lunr.th.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(t){if(void 0===t)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===t.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var i="2"==t.version[0];t.th=function(){this.pipeline.reset(),this.pipeline.add(t.th.trimmer),i?this.tokenizer=t.th.tokenizer:(t.tokenizer&&(t.tokenizer=t.th.tokenizer),this.tokenizerFn&&(this.tokenizerFn=t.th.tokenizer))},t.th.wordCharacters="[-]",t.th.trimmer=t.trimmerSupport.generateTrimmer(t.th.wordCharacters),t.Pipeline.registerFunction(t.th.trimmer,"trimmer-th");var n=t.wordcut;n.init(),t.th.tokenizer=function(e){if(!arguments.length||null==e||null==e)return[];if(Array.isArray(e))return e.map(function(e){return i?new t.Token(e):e});var r=e.toString().replace(/^\s+/,"");return n.cut(r).split("|")}}});
|
||||||
1
docs/assets/javascripts/lunr/lunr.tr.js
Normal file
1
docs/assets/javascripts/lunr/tinyseg.js
Normal file
1
docs/assets/javascripts/lunr/wordcut.js
Normal file
1
docs/assets/javascripts/modernizr.74668098.js
Normal file
1
docs/assets/stylesheets/application-palette.224b79ff.css
Normal file
1
docs/assets/stylesheets/application.750b69bd.css
Normal file
@@ -1,99 +1,147 @@
|
|||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html class="no-js">
|
|
||||||
|
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en" class="no-js">
|
||||||
<head>
|
<head>
|
||||||
|
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
|
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="shortcut icon" href="../assets/images/favicon.png">
|
<meta name="lang:clipboard.copy" content="Copy to clipboard">
|
||||||
|
|
||||||
<meta name="generator" content="mkdocs-0.16.3, mkdocs-material-1.5.4">
|
<meta name="lang:clipboard.copied" content="Copied to clipboard">
|
||||||
|
|
||||||
|
<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.one" content="1 matching document">
|
||||||
|
|
||||||
|
<meta name="lang:search.result.other" content="# matching documents">
|
||||||
|
|
||||||
|
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||||
|
|
||||||
|
<link rel="shortcut icon" href="../assets/images/favicon.png">
|
||||||
|
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.2.0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<title>Convert - Yaml</title>
|
<title>Convert - Yq</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script src="../assets/javascripts/modernizr-56ade86843.js"></script>
|
<link rel="stylesheet" href="../assets/stylesheets/application.750b69bd.css">
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../assets/stylesheets/application-b1a1975878.css">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<script src="../assets/javascripts/modernizr.74668098.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 dir="ltr">
|
||||||
|
|
||||||
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<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">
|
||||||
<div class="md-flex">
|
<div class="md-flex">
|
||||||
<div class="md-flex__cell md-flex__cell--shrink">
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
<a href=".." title="Yq" class="md-header-nav__button md-logo">
|
||||||
<a href=".." title="Yaml" class="md-icon md-icon--home md-header-nav__button">
|
|
||||||
</a>
|
<i class="md-icon"></i>
|
||||||
|
|
||||||
|
</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">
|
||||||
<span class="md-flex__ellipsis md-header-nav__title">
|
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
||||||
|
|
||||||
|
<span class="md-header-nav__topic">
|
||||||
|
Yq
|
||||||
|
</span>
|
||||||
Convert
|
<span class="md-header-nav__topic">
|
||||||
|
Convert
|
||||||
|
</span>
|
||||||
|
|
||||||
</span>
|
</div>
|
||||||
</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--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">
|
<div class="md-search" data-md-component="search" role="dialog">
|
||||||
<div class="md-search__overlay"></div>
|
<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" accesskey="s" 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">close</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>
|
||||||
<div class="md-search-result" data-md-component="result">
|
<div class="md-search-result" data-md-component="result">
|
||||||
<div class="md-search-result__meta" data-md-lang-result-none="No matching documents" data-md-lang-result-one="1 matching document" data-md-lang-result-other="# matching documents">
|
<div class="md-search-result__meta">
|
||||||
Type to start searching
|
Type to start searching
|
||||||
</div>
|
</div>
|
||||||
<ol class="md-search-result__list"></ol>
|
<ol class="md-search-result__list"></ol>
|
||||||
@@ -104,37 +152,37 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="md-flex__cell md-flex__cell--shrink">
|
|
||||||
<div class="md-header-nav__source">
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
<div class="md-header-nav__source">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://github.com/mikefarah/yq/" title="Go to repository" class="md-source" data-md-source="github">
|
||||||
<a href="https://github.com/mikefarah/yaml" title="Go to repository" class="md-source" data-md-source="github">
|
|
||||||
|
<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 class="md-source__repository">
|
|
||||||
mikefarah/yaml
|
|
||||||
</div>
|
</div>
|
||||||
</a>
|
|
||||||
|
<div class="md-source__repository">
|
||||||
|
mikefarah/yq
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div class="md-container">
|
<div class="md-container">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<main class="md-main">
|
<main class="md-main">
|
||||||
<div class="md-main__inner md-grid" data-md-component="container">
|
<div class="md-main__inner md-grid" data-md-component="container">
|
||||||
@@ -144,11 +192,13 @@
|
|||||||
<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">
|
||||||
|
<a href=".." title="Yq" class="md-nav__button md-logo">
|
||||||
<i class="md-icon md-icon--home md-nav__button"></i>
|
|
||||||
|
<i class="md-icon"></i>
|
||||||
Yaml
|
|
||||||
|
</a>
|
||||||
|
Yq
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<div class="md-nav__source">
|
<div class="md-nav__source">
|
||||||
@@ -157,20 +207,18 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://github.com/mikefarah/yq/" title="Go to repository" class="md-source" data-md-source="github">
|
||||||
<a href="https://github.com/mikefarah/yaml" title="Go to repository" class="md-source" data-md-source="github">
|
|
||||||
|
<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 class="md-source__repository">
|
|
||||||
mikefarah/yaml
|
|
||||||
</div>
|
</div>
|
||||||
</a>
|
|
||||||
|
<div class="md-source__repository">
|
||||||
|
mikefarah/yq
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ul class="md-nav__list" data-md-scrollfix>
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
@@ -216,6 +264,30 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../prefix/" title="Prefix" class="md-nav__link">
|
||||||
|
Prefix
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../delete/" title="Delete" class="md-nav__link">
|
||||||
|
Delete
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<li class="md-nav__item">
|
<li class="md-nav__item">
|
||||||
<a href="../create/" title="Create" class="md-nav__link">
|
<a href="../create/" title="Create" class="md-nav__link">
|
||||||
Create
|
Create
|
||||||
@@ -232,10 +304,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>
|
||||||
|
|
||||||
@@ -248,7 +320,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">
|
||||||
@@ -267,6 +339,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</nav>
|
</nav>
|
||||||
@@ -274,6 +348,18 @@
|
|||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../merge/" title="Merge" class="md-nav__link">
|
||||||
|
Merge
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
@@ -289,7 +375,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">
|
||||||
@@ -308,6 +394,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</nav>
|
</nav>
|
||||||
@@ -320,18 +408,20 @@
|
|||||||
<article class="md-content__inner md-typeset">
|
<article class="md-content__inner md-typeset">
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://github.com/mikefarah/yq/edit/master/docs/convert.md" title="Edit this page" class="md-icon md-content__icon"></a>
|
||||||
|
|
||||||
|
|
||||||
<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
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>then</p>
|
<p>then</p>
|
||||||
<pre><code class="bash">yaml r -j sample.yaml b.c
|
<pre><code class="bash">yq r -j sample.yaml b.c
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>will output</p>
|
<p>will output</p>
|
||||||
@@ -345,7 +435,7 @@
|
|||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>then</p>
|
<p>then</p>
|
||||||
<pre><code class="bash">yaml r sample.json
|
<pre><code class="bash">yq r sample.json
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>will output</p>
|
<p>will output</p>
|
||||||
@@ -362,6 +452,8 @@ b:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
@@ -389,6 +481,20 @@ b:
|
|||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
<a href="../merge/" title="Merge" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
|
||||||
|
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
|
||||||
|
<span class="md-flex__ellipsis">
|
||||||
|
<span class="md-footer-nav__direction">
|
||||||
|
Next
|
||||||
|
</span>
|
||||||
|
Merge
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
<i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -397,16 +503,14 @@ b:
|
|||||||
<div class="md-footer-copyright">
|
<div class="md-footer-copyright">
|
||||||
|
|
||||||
powered by
|
powered by
|
||||||
<a href="http://www.mkdocs.org" title="MkDocs">MkDocs</a>
|
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||||
and
|
and
|
||||||
<a href="http://squidfunk.github.io/mkdocs-material/" title="Material for MkDocs">
|
<a href="https://squidfunk.github.io/mkdocs-material/">
|
||||||
Material for MkDocs</a>
|
Material for MkDocs</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<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>
|
||||||
|
|
||||||
@@ -414,18 +518,15 @@ b:
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="../assets/javascripts/application-0b7df094bf.js"></script>
|
<script src="../assets/javascripts/application.39abc4af.js"></script>
|
||||||
<script>app.initialize({url:{base:".."}})</script>
|
|
||||||
|
|
||||||
|
<script>app.initialize({version:"1.0.4",url:{base:".."}})</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -1,99 +1,147 @@
|
|||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html class="no-js">
|
|
||||||
|
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en" class="no-js">
|
||||||
<head>
|
<head>
|
||||||
|
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
|
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="shortcut icon" href="../assets/images/favicon.png">
|
<meta name="lang:clipboard.copy" content="Copy to clipboard">
|
||||||
|
|
||||||
<meta name="generator" content="mkdocs-0.16.3, mkdocs-material-1.5.4">
|
<meta name="lang:clipboard.copied" content="Copied to clipboard">
|
||||||
|
|
||||||
|
<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.one" content="1 matching document">
|
||||||
|
|
||||||
|
<meta name="lang:search.result.other" content="# matching documents">
|
||||||
|
|
||||||
|
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||||
|
|
||||||
|
<link rel="shortcut icon" href="../assets/images/favicon.png">
|
||||||
|
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.2.0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<title>Create - Yaml</title>
|
<title>Create - Yq</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script src="../assets/javascripts/modernizr-56ade86843.js"></script>
|
<link rel="stylesheet" href="../assets/stylesheets/application.750b69bd.css">
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../assets/stylesheets/application-b1a1975878.css">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<script src="../assets/javascripts/modernizr.74668098.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 dir="ltr">
|
||||||
|
|
||||||
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<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">
|
||||||
<div class="md-flex">
|
<div class="md-flex">
|
||||||
<div class="md-flex__cell md-flex__cell--shrink">
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
<a href=".." title="Yq" class="md-header-nav__button md-logo">
|
||||||
<a href=".." title="Yaml" class="md-icon md-icon--home md-header-nav__button">
|
|
||||||
</a>
|
<i class="md-icon"></i>
|
||||||
|
|
||||||
|
</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">
|
||||||
<span class="md-flex__ellipsis md-header-nav__title">
|
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
||||||
|
|
||||||
|
<span class="md-header-nav__topic">
|
||||||
|
Yq
|
||||||
|
</span>
|
||||||
Create
|
<span class="md-header-nav__topic">
|
||||||
|
Create
|
||||||
|
</span>
|
||||||
|
|
||||||
</span>
|
</div>
|
||||||
</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--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">
|
<div class="md-search" data-md-component="search" role="dialog">
|
||||||
<div class="md-search__overlay"></div>
|
<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" accesskey="s" 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">close</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>
|
||||||
<div class="md-search-result" data-md-component="result">
|
<div class="md-search-result" data-md-component="result">
|
||||||
<div class="md-search-result__meta" data-md-lang-result-none="No matching documents" data-md-lang-result-one="1 matching document" data-md-lang-result-other="# matching documents">
|
<div class="md-search-result__meta">
|
||||||
Type to start searching
|
Type to start searching
|
||||||
</div>
|
</div>
|
||||||
<ol class="md-search-result__list"></ol>
|
<ol class="md-search-result__list"></ol>
|
||||||
@@ -104,37 +152,37 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="md-flex__cell md-flex__cell--shrink">
|
|
||||||
<div class="md-header-nav__source">
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
<div class="md-header-nav__source">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://github.com/mikefarah/yq/" title="Go to repository" class="md-source" data-md-source="github">
|
||||||
<a href="https://github.com/mikefarah/yaml" title="Go to repository" class="md-source" data-md-source="github">
|
|
||||||
|
<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 class="md-source__repository">
|
|
||||||
mikefarah/yaml
|
|
||||||
</div>
|
</div>
|
||||||
</a>
|
|
||||||
|
<div class="md-source__repository">
|
||||||
|
mikefarah/yq
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div class="md-container">
|
<div class="md-container">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<main class="md-main">
|
<main class="md-main">
|
||||||
<div class="md-main__inner md-grid" data-md-component="container">
|
<div class="md-main__inner md-grid" data-md-component="container">
|
||||||
@@ -144,11 +192,13 @@
|
|||||||
<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">
|
||||||
|
<a href=".." title="Yq" class="md-nav__button md-logo">
|
||||||
<i class="md-icon md-icon--home md-nav__button"></i>
|
|
||||||
|
<i class="md-icon"></i>
|
||||||
Yaml
|
|
||||||
|
</a>
|
||||||
|
Yq
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<div class="md-nav__source">
|
<div class="md-nav__source">
|
||||||
@@ -157,20 +207,18 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://github.com/mikefarah/yq/" title="Go to repository" class="md-source" data-md-source="github">
|
||||||
<a href="https://github.com/mikefarah/yaml" title="Go to repository" class="md-source" data-md-source="github">
|
|
||||||
|
<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 class="md-source__repository">
|
|
||||||
mikefarah/yaml
|
|
||||||
</div>
|
</div>
|
||||||
</a>
|
|
||||||
|
<div class="md-source__repository">
|
||||||
|
mikefarah/yq
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ul class="md-nav__list" data-md-scrollfix>
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
@@ -215,15 +263,39 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../prefix/" title="Prefix" class="md-nav__link">
|
||||||
|
Prefix
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../delete/" title="Delete" class="md-nav__link">
|
||||||
|
Delete
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<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>
|
||||||
|
|
||||||
@@ -236,7 +308,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">
|
||||||
@@ -253,6 +325,22 @@
|
|||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#keys-with-dots" title="Keys with dots" class="md-nav__link">
|
||||||
|
Keys with dots
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#keys-and-values-with-leading-dashes" title="Keys (and values) with leading dashes" class="md-nav__link">
|
||||||
|
Keys (and values) with leading dashes
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
@@ -274,6 +362,18 @@
|
|||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../merge/" title="Merge" class="md-nav__link">
|
||||||
|
Merge
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
@@ -289,7 +389,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">
|
||||||
@@ -306,6 +406,22 @@
|
|||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#keys-with-dots" title="Keys with dots" class="md-nav__link">
|
||||||
|
Keys with dots
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#keys-and-values-with-leading-dashes" title="Keys (and values) with leading dashes" class="md-nav__link">
|
||||||
|
Keys (and values) with leading dashes
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
@@ -320,15 +436,17 @@
|
|||||||
<article class="md-content__inner md-typeset">
|
<article class="md-content__inner md-typeset">
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://github.com/mikefarah/yq/edit/master/docs/create.md" title="Edit this page" class="md-icon md-content__icon"></a>
|
||||||
|
|
||||||
|
|
||||||
<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>yaml n <path> <new value>
|
<pre><code>yq n <path> <new value>
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<h3 id="creating-a-simple-yaml-file">Creating a simple yaml file<a class="headerlink" href="#creating-a-simple-yaml-file" title="Permanent link">¶</a></h3>
|
<h3 id="creating-a-simple-yaml-file">Creating a simple yaml file<a class="headerlink" href="#creating-a-simple-yaml-file" title="Permanent link">¶</a></h3>
|
||||||
<pre><code class="bash">yaml n b.c cat
|
<pre><code class="bash">yq n b.c cat
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>will output:</p>
|
<p>will output:</p>
|
||||||
@@ -340,11 +458,11 @@
|
|||||||
<p>Create scripts follow the same format as the update scripts.</p>
|
<p>Create scripts follow the same format as the update scripts.</p>
|
||||||
<p>Given a script create_instructions.yaml of:</p>
|
<p>Given a script create_instructions.yaml of:</p>
|
||||||
<pre><code class="yaml">b.c: 3
|
<pre><code class="yaml">b.c: 3
|
||||||
b.e[0].name: Howdy Partner
|
b.e[+].name: Howdy Partner
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>then</p>
|
<p>then</p>
|
||||||
<pre><code class="bash">yaml n -s create_instructions.yaml
|
<pre><code class="bash">yq n -s create_instructions.yaml
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>will output:</p>
|
<p>will output:</p>
|
||||||
@@ -355,14 +473,40 @@ b.e[0].name: Howdy Partner
|
|||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>You can also pipe the instructions in:</p>
|
<p>You can also pipe the instructions in:</p>
|
||||||
<pre><code class="bash">cat create_instructions.yaml | yaml n -s -
|
<pre><code class="bash">cat create_instructions.yaml | yq n -s -
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
<pre><code class="yaml">b:
|
||||||
|
foo.bar: 7
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<pre><code class="bash">yaml r sample.yaml 'b[foo.bar]'
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<pre><code class="bash">yaml w sample.yaml 'b[foo.bar]' 9
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>Any valid yaml key can be specified as part of a key lookup.</p>
|
||||||
|
<p>Note that the path is in quotes to avoid the square brackets being interpreted by your shell.</p>
|
||||||
|
<h3 id="keys-and-values-with-leading-dashes">Keys (and values) with leading dashes<a class="headerlink" href="#keys-and-values-with-leading-dashes" title="Permanent link">¶</a></h3>
|
||||||
|
<p>If a key or value has leading dashes, yq won't know that you are passing a value as opposed to a flag (and you will get a 'bad flag syntax' error).</p>
|
||||||
|
<p>To fix that, you will need to tell it to stop processing flags by adding '--' after the last flag like so:</p>
|
||||||
|
<pre><code class="bash">yq n -t -- --key --value
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>Will result in</p>
|
||||||
|
<p><code>`
|
||||||
|
--key: --value</code></p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
@@ -375,7 +519,7 @@ b.e[0].name: Howdy Partner
|
|||||||
<div class="md-footer-nav">
|
<div class="md-footer-nav">
|
||||||
<nav class="md-footer-nav__inner md-grid">
|
<nav class="md-footer-nav__inner md-grid">
|
||||||
|
|
||||||
<a href="../write/" title="Write/Update" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
|
<a href="../delete/" title="Delete" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
|
||||||
<div class="md-flex__cell md-flex__cell--shrink">
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
<i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
|
<i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
|
||||||
</div>
|
</div>
|
||||||
@@ -384,7 +528,7 @@ b.e[0].name: Howdy Partner
|
|||||||
<span class="md-footer-nav__direction">
|
<span class="md-footer-nav__direction">
|
||||||
Previous
|
Previous
|
||||||
</span>
|
</span>
|
||||||
Write/Update
|
Delete
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
@@ -412,16 +556,14 @@ 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" title="MkDocs">MkDocs</a>
|
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||||
and
|
and
|
||||||
<a href="http://squidfunk.github.io/mkdocs-material/" title="Material for MkDocs">
|
<a href="https://squidfunk.github.io/mkdocs-material/">
|
||||||
Material for MkDocs</a>
|
Material for MkDocs</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<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>
|
||||||
|
|
||||||
@@ -429,18 +571,15 @@ b.e[0].name: Howdy Partner
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="../assets/javascripts/application-0b7df094bf.js"></script>
|
<script src="../assets/javascripts/application.39abc4af.js"></script>
|
||||||
<script>app.initialize({url:{base:".."}})</script>
|
|
||||||
|
|
||||||
|
<script>app.initialize({version:"1.0.4",url:{base:".."}})</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
833
docs/delete/index.html
Normal file
@@ -0,0 +1,833 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en" class="no-js">
|
||||||
|
<head>
|
||||||
|
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
|
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<meta name="lang:clipboard.copy" content="Copy to clipboard">
|
||||||
|
|
||||||
|
<meta name="lang:clipboard.copied" content="Copied to clipboard">
|
||||||
|
|
||||||
|
<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.one" content="1 matching document">
|
||||||
|
|
||||||
|
<meta name="lang:search.result.other" content="# matching documents">
|
||||||
|
|
||||||
|
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||||
|
|
||||||
|
<link rel="shortcut icon" href="../assets/images/favicon.png">
|
||||||
|
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.2.0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<title>Delete - Yq</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="../assets/stylesheets/application.750b69bd.css">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<script src="../assets/javascripts/modernizr.74668098.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">
|
||||||
|
<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="../assets/fonts/material-icons.css">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body dir="ltr">
|
||||||
|
|
||||||
|
<svg class="md-svg">
|
||||||
|
<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 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>
|
||||||
|
</svg>
|
||||||
|
<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" autocomplete="off">
|
||||||
|
<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">
|
||||||
|
<nav class="md-header-nav md-grid">
|
||||||
|
<div class="md-flex">
|
||||||
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
<a href=".." title="Yq" class="md-header-nav__button md-logo">
|
||||||
|
|
||||||
|
<i class="md-icon"></i>
|
||||||
|
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
<label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
|
||||||
|
</div>
|
||||||
|
<div class="md-flex__cell md-flex__cell--stretch">
|
||||||
|
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
||||||
|
|
||||||
|
<span class="md-header-nav__topic">
|
||||||
|
Yq
|
||||||
|
</span>
|
||||||
|
<span class="md-header-nav__topic">
|
||||||
|
Delete
|
||||||
|
</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
|
||||||
|
<label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
|
||||||
|
|
||||||
|
<div class="md-search" data-md-component="search" role="dialog">
|
||||||
|
<label class="md-search__overlay" for="__search"></label>
|
||||||
|
<div class="md-search__inner" role="search">
|
||||||
|
<form class="md-search__form" name="search">
|
||||||
|
<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>
|
||||||
|
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||||
|

|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
<div class="md-search__output">
|
||||||
|
<div class="md-search__scrollwrap" data-md-scrollfix>
|
||||||
|
<div class="md-search-result" data-md-component="result">
|
||||||
|
<div class="md-search-result__meta">
|
||||||
|
Type to start searching
|
||||||
|
</div>
|
||||||
|
<ol class="md-search-result__list"></ol>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
<div class="md-header-nav__source">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://github.com/mikefarah/yq/" title="Go to repository" class="md-source" data-md-source="github">
|
||||||
|
|
||||||
|
<div class="md-source__icon">
|
||||||
|
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||||
|
<use xlink:href="#__github" width="24" height="24"></use>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="md-source__repository">
|
||||||
|
mikefarah/yq
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<div class="md-container">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<main class="md-main">
|
||||||
|
<div class="md-main__inner md-grid" data-md-component="container">
|
||||||
|
|
||||||
|
|
||||||
|
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
|
||||||
|
<div class="md-sidebar__scrollwrap">
|
||||||
|
<div class="md-sidebar__inner">
|
||||||
|
<nav class="md-nav md-nav--primary" data-md-level="0">
|
||||||
|
<label class="md-nav__title md-nav__title--site" for="__drawer">
|
||||||
|
<a href=".." title="Yq" class="md-nav__button md-logo">
|
||||||
|
|
||||||
|
<i class="md-icon"></i>
|
||||||
|
|
||||||
|
</a>
|
||||||
|
Yq
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<div class="md-nav__source">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://github.com/mikefarah/yq/" title="Go to repository" class="md-source" data-md-source="github">
|
||||||
|
|
||||||
|
<div class="md-source__icon">
|
||||||
|
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||||
|
<use xlink:href="#__github" width="24" height="24"></use>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="md-source__repository">
|
||||||
|
mikefarah/yq
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href=".." title="Install" class="md-nav__link">
|
||||||
|
Install
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../read/" title="Read" class="md-nav__link">
|
||||||
|
Read
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../write/" title="Write/Update" class="md-nav__link">
|
||||||
|
Write/Update
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../prefix/" title="Prefix" class="md-nav__link">
|
||||||
|
Prefix
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item md-nav__item--active">
|
||||||
|
|
||||||
|
<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">
|
||||||
|
Delete
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<a href="./" title="Delete" class="md-nav__link md-nav__link--active">
|
||||||
|
Delete
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
<nav class="md-nav md-nav--secondary">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#to-stdout" title="To Stdout" class="md-nav__link">
|
||||||
|
To Stdout
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#from-stdin" title="From STDIN" class="md-nav__link">
|
||||||
|
From STDIN
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#deleting-array-elements" title="Deleting array elements" class="md-nav__link">
|
||||||
|
Deleting array elements
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#deleting-nodes-in-place" title="Deleting nodes in-place" class="md-nav__link">
|
||||||
|
Deleting nodes in-place
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#splat" title="Splat" class="md-nav__link">
|
||||||
|
Splat
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#prefix-splat" title="Prefix Splat" class="md-nav__link">
|
||||||
|
Prefix Splat
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#array-splat" title="Array Splat" class="md-nav__link">
|
||||||
|
Array Splat
|
||||||
|
</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 class="md-nav__item">
|
||||||
|
<a href="#keys-with-dots" title="Keys with dots" class="md-nav__link">
|
||||||
|
Keys with dots
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#keys-and-values-with-leading-dashes" title="Keys (and values) with leading dashes" class="md-nav__link">
|
||||||
|
Keys (and values) with leading dashes
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../create/" title="Create" class="md-nav__link">
|
||||||
|
Create
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../convert/" title="Convert" class="md-nav__link">
|
||||||
|
Convert
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../merge/" title="Merge" class="md-nav__link">
|
||||||
|
Merge
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
|
||||||
|
<div class="md-sidebar__scrollwrap">
|
||||||
|
<div class="md-sidebar__inner">
|
||||||
|
|
||||||
|
<nav class="md-nav md-nav--secondary">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#to-stdout" title="To Stdout" class="md-nav__link">
|
||||||
|
To Stdout
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#from-stdin" title="From STDIN" class="md-nav__link">
|
||||||
|
From STDIN
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#deleting-array-elements" title="Deleting array elements" class="md-nav__link">
|
||||||
|
Deleting array elements
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#deleting-nodes-in-place" title="Deleting nodes in-place" class="md-nav__link">
|
||||||
|
Deleting nodes in-place
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#splat" title="Splat" class="md-nav__link">
|
||||||
|
Splat
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#prefix-splat" title="Prefix Splat" class="md-nav__link">
|
||||||
|
Prefix Splat
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#array-splat" title="Array Splat" class="md-nav__link">
|
||||||
|
Array Splat
|
||||||
|
</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 class="md-nav__item">
|
||||||
|
<a href="#keys-with-dots" title="Keys with dots" class="md-nav__link">
|
||||||
|
Keys with dots
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#keys-and-values-with-leading-dashes" title="Keys (and values) with leading dashes" class="md-nav__link">
|
||||||
|
Keys (and values) with leading dashes
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="md-content">
|
||||||
|
<article class="md-content__inner md-typeset">
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://github.com/mikefarah/yq/edit/master/docs/delete.md" title="Edit this page" class="md-icon md-content__icon"></a>
|
||||||
|
|
||||||
|
|
||||||
|
<h1>Delete</h1>
|
||||||
|
|
||||||
|
<pre><code>yq d <yaml_file> <path_to_delete>
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
<pre><code class="yaml">b:
|
||||||
|
c: 2
|
||||||
|
apples: green
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>then</p>
|
||||||
|
<pre><code class="bash">yq d sample.yaml b.c
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>will output:</p>
|
||||||
|
<pre><code class="yaml">b:
|
||||||
|
apples: green
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<h3 id="from-stdin">From STDIN<a class="headerlink" href="#from-stdin" title="Permanent link">¶</a></h3>
|
||||||
|
<pre><code class="bash">cat sample.yaml | yq d - b.c
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<h3 id="deleting-array-elements">Deleting array elements<a class="headerlink" href="#deleting-array-elements" title="Permanent link">¶</a></h3>
|
||||||
|
<p>Given a sample.yaml file of:</p>
|
||||||
|
<pre><code class="yaml">b:
|
||||||
|
c:
|
||||||
|
- 1
|
||||||
|
- 2
|
||||||
|
- 3
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>then</p>
|
||||||
|
<pre><code class="bash">yq d sample.yaml 'b.c[1]'
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>will output:</p>
|
||||||
|
<pre><code class="yaml">b:
|
||||||
|
c:
|
||||||
|
- 1
|
||||||
|
- 3
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<h3 id="deleting-nodes-in-place">Deleting nodes in-place<a class="headerlink" href="#deleting-nodes-in-place" title="Permanent link">¶</a></h3>
|
||||||
|
<p>Given a sample.yaml file of:</p>
|
||||||
|
<pre><code class="yaml">b:
|
||||||
|
c: 2
|
||||||
|
apples: green
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>then</p>
|
||||||
|
<pre><code class="bash">yq d -i sample.yaml b.c
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>will update the sample.yaml file so that the 'c' node is deleted</p>
|
||||||
|
<h3 id="splat">Splat<a class="headerlink" href="#splat" title="Permanent link">¶</a></h3>
|
||||||
|
<p>Given a sample.yaml file of:</p>
|
||||||
|
<pre><code class="yaml">---
|
||||||
|
bob:
|
||||||
|
item1:
|
||||||
|
cats: bananas
|
||||||
|
dogs: woof
|
||||||
|
item2:
|
||||||
|
cats: apples
|
||||||
|
dogs: woof2
|
||||||
|
thing:
|
||||||
|
cats: oranges
|
||||||
|
dogs: woof3
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>then</p>
|
||||||
|
<pre><code class="bash">yq d sample.yaml bob.*.cats
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>will output:</p>
|
||||||
|
<pre><code class="yaml">---
|
||||||
|
bob:
|
||||||
|
item1:
|
||||||
|
dogs: woof
|
||||||
|
item2:
|
||||||
|
dogs: woof2
|
||||||
|
thing:
|
||||||
|
dogs: woof3
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<h3 id="prefix-splat">Prefix Splat<a class="headerlink" href="#prefix-splat" title="Permanent link">¶</a></h3>
|
||||||
|
<p>Given a sample.yaml file of:</p>
|
||||||
|
<pre><code class="yaml">---
|
||||||
|
bob:
|
||||||
|
item1:
|
||||||
|
cats: bananas
|
||||||
|
dogs: woof
|
||||||
|
item2:
|
||||||
|
cats: apples
|
||||||
|
dogs: woof2
|
||||||
|
thing:
|
||||||
|
cats: oranges
|
||||||
|
dogs: woof3
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>then</p>
|
||||||
|
<pre><code class="bash">yq d sample.yaml bob.item*.cats
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>will output:</p>
|
||||||
|
<pre><code class="yaml">---
|
||||||
|
bob:
|
||||||
|
item1:
|
||||||
|
dogs: woof
|
||||||
|
item2:
|
||||||
|
dogs: woof2
|
||||||
|
thing:
|
||||||
|
cats: oranges
|
||||||
|
dogs: woof3
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<h3 id="array-splat">Array Splat<a class="headerlink" href="#array-splat" title="Permanent link">¶</a></h3>
|
||||||
|
<p>Given a sample.yaml file of:</p>
|
||||||
|
<pre><code class="yaml">---
|
||||||
|
bob:
|
||||||
|
- cats: bananas
|
||||||
|
dogs: woof
|
||||||
|
- cats: apples
|
||||||
|
dogs: woof2
|
||||||
|
- cats: oranges
|
||||||
|
dogs: woof3
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>then</p>
|
||||||
|
<pre><code class="bash">yq d sample.yaml bob.[*].cats
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>will output:</p>
|
||||||
|
<pre><code class="yaml">---
|
||||||
|
bob:
|
||||||
|
- dogs: woof
|
||||||
|
- dogs: woof2
|
||||||
|
- dogs: woof3
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
<p>When specifying a key that has a dot use key lookup indicator.</p>
|
||||||
|
<pre><code class="yaml">b:
|
||||||
|
foo.bar: 7
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<pre><code class="bash">yaml r sample.yaml 'b[foo.bar]'
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<pre><code class="bash">yaml w sample.yaml 'b[foo.bar]' 9
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>Any valid yaml key can be specified as part of a key lookup.</p>
|
||||||
|
<p>Note that the path is in quotes to avoid the square brackets being interpreted by your shell.</p>
|
||||||
|
<h3 id="keys-and-values-with-leading-dashes">Keys (and values) with leading dashes<a class="headerlink" href="#keys-and-values-with-leading-dashes" title="Permanent link">¶</a></h3>
|
||||||
|
<p>If a key or value has leading dashes, yq won't know that you are passing a value as opposed to a flag (and you will get a 'bad flag syntax' error).</p>
|
||||||
|
<p>To fix that, you will need to tell it to stop processing flags by adding '--' after the last flag like so:</p>
|
||||||
|
<pre><code class="bash">yq n -t -- --key --value
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>Will result in</p>
|
||||||
|
<p><code>`
|
||||||
|
--key: --value</code></p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</article>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
|
||||||
|
<footer class="md-footer">
|
||||||
|
|
||||||
|
<div class="md-footer-nav">
|
||||||
|
<nav class="md-footer-nav__inner md-grid">
|
||||||
|
|
||||||
|
<a href="../prefix/" title="Prefix" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
|
||||||
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
<i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
|
||||||
|
</div>
|
||||||
|
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
|
||||||
|
<span class="md-flex__ellipsis">
|
||||||
|
<span class="md-footer-nav__direction">
|
||||||
|
Previous
|
||||||
|
</span>
|
||||||
|
Prefix
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
<a href="../create/" title="Create" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
|
||||||
|
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
|
||||||
|
<span class="md-flex__ellipsis">
|
||||||
|
<span class="md-footer-nav__direction">
|
||||||
|
Next
|
||||||
|
</span>
|
||||||
|
Create
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
<i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="md-footer-meta md-typeset">
|
||||||
|
<div class="md-footer-meta__inner md-grid">
|
||||||
|
<div class="md-footer-copyright">
|
||||||
|
|
||||||
|
powered by
|
||||||
|
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||||
|
and
|
||||||
|
<a href="https://squidfunk.github.io/mkdocs-material/">
|
||||||
|
Material for MkDocs</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="md-footer-social">
|
||||||
|
<link rel="stylesheet" href="../assets/fonts/font-awesome.css">
|
||||||
|
|
||||||
|
<a href="https://github.com/mikefarah" class="md-footer-social__link fa fa-github"></a>
|
||||||
|
|
||||||
|
<a href="https://www.linkedin.com/in/mike-farah-b5a75b2/" class="md-footer-social__link fa fa-linkedin"></a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="../assets/javascripts/application.39abc4af.js"></script>
|
||||||
|
|
||||||
|
<script>app.initialize({version:"1.0.4",url:{base:".."}})</script>
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
312
docs/index.html
@@ -1,99 +1,147 @@
|
|||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html class="no-js">
|
|
||||||
|
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en" class="no-js">
|
||||||
<head>
|
<head>
|
||||||
|
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
|
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="shortcut icon" href="./assets/images/favicon.png">
|
<meta name="lang:clipboard.copy" content="Copy to clipboard">
|
||||||
|
|
||||||
<meta name="generator" content="mkdocs-0.16.3, mkdocs-material-1.5.4">
|
<meta name="lang:clipboard.copied" content="Copied to clipboard">
|
||||||
|
|
||||||
|
<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.one" content="1 matching document">
|
||||||
|
|
||||||
|
<meta name="lang:search.result.other" content="# matching documents">
|
||||||
|
|
||||||
|
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||||
|
|
||||||
|
<link rel="shortcut icon" href="assets/images/favicon.png">
|
||||||
|
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.2.0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<title>Yaml</title>
|
<title>Yq</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script src="./assets/javascripts/modernizr-56ade86843.js"></script>
|
<link rel="stylesheet" href="assets/stylesheets/application.750b69bd.css">
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="./assets/stylesheets/application-b1a1975878.css">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<script src="assets/javascripts/modernizr.74668098.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 dir="ltr">
|
||||||
|
|
||||||
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<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">
|
||||||
<div class="md-flex">
|
<div class="md-flex">
|
||||||
<div class="md-flex__cell md-flex__cell--shrink">
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
<a href="." title="Yq" class="md-header-nav__button md-logo">
|
||||||
<a href="." title="Yaml" class="md-icon md-icon--home md-header-nav__button">
|
|
||||||
</a>
|
<i class="md-icon"></i>
|
||||||
|
|
||||||
|
</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">
|
||||||
<span class="md-flex__ellipsis md-header-nav__title">
|
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
||||||
|
|
||||||
|
<span class="md-header-nav__topic">
|
||||||
|
Yq
|
||||||
|
</span>
|
||||||
Install
|
<span class="md-header-nav__topic">
|
||||||
|
Install
|
||||||
|
</span>
|
||||||
|
|
||||||
</span>
|
</div>
|
||||||
</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--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">
|
<div class="md-search" data-md-component="search" role="dialog">
|
||||||
<div class="md-search__overlay"></div>
|
<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" accesskey="s" 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">close</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>
|
||||||
<div class="md-search-result" data-md-component="result">
|
<div class="md-search-result" data-md-component="result">
|
||||||
<div class="md-search-result__meta" data-md-lang-result-none="No matching documents" data-md-lang-result-one="1 matching document" data-md-lang-result-other="# matching documents">
|
<div class="md-search-result__meta">
|
||||||
Type to start searching
|
Type to start searching
|
||||||
</div>
|
</div>
|
||||||
<ol class="md-search-result__list"></ol>
|
<ol class="md-search-result__list"></ol>
|
||||||
@@ -104,37 +152,37 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="md-flex__cell md-flex__cell--shrink">
|
|
||||||
<div class="md-header-nav__source">
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
<div class="md-header-nav__source">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://github.com/mikefarah/yq/" title="Go to repository" class="md-source" data-md-source="github">
|
||||||
<a href="https://github.com/mikefarah/yaml" title="Go to repository" class="md-source" data-md-source="github">
|
|
||||||
|
<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 class="md-source__repository">
|
|
||||||
mikefarah/yaml
|
|
||||||
</div>
|
</div>
|
||||||
</a>
|
|
||||||
|
<div class="md-source__repository">
|
||||||
|
mikefarah/yq
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div class="md-container">
|
<div class="md-container">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<main class="md-main">
|
<main class="md-main">
|
||||||
<div class="md-main__inner md-grid" data-md-component="container">
|
<div class="md-main__inner md-grid" data-md-component="container">
|
||||||
@@ -144,11 +192,13 @@
|
|||||||
<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">
|
||||||
|
<a href="." title="Yq" class="md-nav__button md-logo">
|
||||||
<i class="md-icon md-icon--home md-nav__button"></i>
|
|
||||||
|
<i class="md-icon"></i>
|
||||||
Yaml
|
|
||||||
|
</a>
|
||||||
|
Yq
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<div class="md-nav__source">
|
<div class="md-nav__source">
|
||||||
@@ -157,20 +207,18 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://github.com/mikefarah/yq/" title="Go to repository" class="md-source" data-md-source="github">
|
||||||
<a href="https://github.com/mikefarah/yaml" title="Go to repository" class="md-source" data-md-source="github">
|
|
||||||
|
<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 class="md-source__repository">
|
|
||||||
mikefarah/yaml
|
|
||||||
</div>
|
</div>
|
||||||
</a>
|
|
||||||
|
<div class="md-source__repository">
|
||||||
|
mikefarah/yq
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ul class="md-nav__list" data-md-scrollfix>
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
@@ -184,12 +232,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>
|
||||||
|
|
||||||
@@ -204,22 +252,17 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<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">
|
||||||
<a href="#download-latest-binary" title="download latest binary" class="md-nav__link">
|
<a href="#install" title="Install" class="md-nav__link">
|
||||||
download latest binary
|
Install
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="md-nav__item">
|
|
||||||
<a href="#get-the-source" title="get the source" class="md-nav__link">
|
|
||||||
get the source
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -259,6 +302,30 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="prefix/" title="Prefix" class="md-nav__link">
|
||||||
|
Prefix
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="delete/" title="Delete" class="md-nav__link">
|
||||||
|
Delete
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<li class="md-nav__item">
|
<li class="md-nav__item">
|
||||||
<a href="create/" title="Create" class="md-nav__link">
|
<a href="create/" title="Create" class="md-nav__link">
|
||||||
Create
|
Create
|
||||||
@@ -278,6 +345,18 @@
|
|||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="merge/" title="Merge" class="md-nav__link">
|
||||||
|
Merge
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
@@ -295,22 +374,17 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<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">
|
||||||
<a href="#download-latest-binary" title="download latest binary" class="md-nav__link">
|
<a href="#install" title="Install" class="md-nav__link">
|
||||||
download latest binary
|
Install
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="md-nav__item">
|
|
||||||
<a href="#get-the-source" title="get the source" class="md-nav__link">
|
|
||||||
get the source
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -326,23 +400,40 @@
|
|||||||
<article class="md-content__inner md-typeset">
|
<article class="md-content__inner md-typeset">
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://github.com/mikefarah/yq/edit/master/docs/index.md" title="Edit this page" class="md-icon md-content__icon"></a>
|
||||||
|
|
||||||
<h1 id="yaml">yaml<a class="headerlink" href="#yaml" title="Permanent link">¶</a></h1>
|
|
||||||
<p>yaml is a lightweight and portable command-line YAML processor</p>
|
<h1 id="yq">yq<a class="headerlink" href="#yq" title="Permanent link">¶</a></h1>
|
||||||
|
<p>yq is a lightweight and portable command-line YAML processor</p>
|
||||||
<p>The aim of the project is to be the <a href="https://github.com/stedolan/jq">jq</a> or sed of yaml files.</p>
|
<p>The aim of the project is to be the <a href="https://github.com/stedolan/jq">jq</a> or sed of yaml files.</p>
|
||||||
<h3 id="download-latest-binary"><a href="https://github.com/mikefarah/yaml/releases/latest">download latest binary</a><a class="headerlink" href="#download-latest-binary" title="Permanent link">¶</a></h3>
|
<h2 id="install">Install<a class="headerlink" href="#install" title="Permanent link">¶</a></h2>
|
||||||
<h3 id="get-the-source">get the source<a class="headerlink" href="#get-the-source" title="Permanent link">¶</a></h3>
|
<p>On MacOS:</p>
|
||||||
<pre><code class="bash">go get github.com/mikefarah/yaml
|
<pre><code>brew install yq
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p><a href="https://github.com/mikefarah/yaml/zipball/master">.zip</a> or <a href="https://github.com/mikefarah/yaml/tarball/master">tar.gz</a></p>
|
<p>On Ubuntu and other Linux distros supporting <code>snap</code> packages:</p>
|
||||||
<p><a href="https://github.com/mikefarah/yaml">View on GitHub</a></p>
|
<pre><code>snap install yq
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>On Ubuntu 16.04 or higher from Debian package:</p>
|
||||||
|
<pre><code>sudo add-apt-repository ppa:rmescandon/yq
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install yq -y
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>or, <a href="https://github.com/mikefarah/yq/releases/latest">Download latest binary</a> or alternatively:</p>
|
||||||
|
<pre><code>go get gopkg.in/mikefarah/yq.v2
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p><a href="https://github.com/mikefarah/yq">View on GitHub</a></p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
@@ -378,16 +469,14 @@
|
|||||||
<div class="md-footer-copyright">
|
<div class="md-footer-copyright">
|
||||||
|
|
||||||
powered by
|
powered by
|
||||||
<a href="http://www.mkdocs.org" title="MkDocs">MkDocs</a>
|
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||||
and
|
and
|
||||||
<a href="http://squidfunk.github.io/mkdocs-material/" title="Material for MkDocs">
|
<a href="https://squidfunk.github.io/mkdocs-material/">
|
||||||
Material for MkDocs</a>
|
Material for MkDocs</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<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>
|
||||||
|
|
||||||
@@ -395,18 +484,15 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="./assets/javascripts/application-0b7df094bf.js"></script>
|
<script src="assets/javascripts/application.39abc4af.js"></script>
|
||||||
<script>app.initialize({url:{base:"."}})</script>
|
|
||||||
|
|
||||||
|
<script>app.initialize({version:"1.0.4",url:{base:"."}})</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
730
docs/merge/index.html
Normal file
@@ -0,0 +1,730 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en" class="no-js">
|
||||||
|
<head>
|
||||||
|
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
|
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<meta name="lang:clipboard.copy" content="Copy to clipboard">
|
||||||
|
|
||||||
|
<meta name="lang:clipboard.copied" content="Copied to clipboard">
|
||||||
|
|
||||||
|
<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.one" content="1 matching document">
|
||||||
|
|
||||||
|
<meta name="lang:search.result.other" content="# matching documents">
|
||||||
|
|
||||||
|
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||||
|
|
||||||
|
<link rel="shortcut icon" href="../assets/images/favicon.png">
|
||||||
|
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.2.0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<title>Merge - Yq</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="../assets/stylesheets/application.750b69bd.css">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<script src="../assets/javascripts/modernizr.74668098.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">
|
||||||
|
<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="../assets/fonts/material-icons.css">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body dir="ltr">
|
||||||
|
|
||||||
|
<svg class="md-svg">
|
||||||
|
<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 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>
|
||||||
|
</svg>
|
||||||
|
<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" autocomplete="off">
|
||||||
|
<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">
|
||||||
|
<nav class="md-header-nav md-grid">
|
||||||
|
<div class="md-flex">
|
||||||
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
<a href=".." title="Yq" class="md-header-nav__button md-logo">
|
||||||
|
|
||||||
|
<i class="md-icon"></i>
|
||||||
|
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
<label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
|
||||||
|
</div>
|
||||||
|
<div class="md-flex__cell md-flex__cell--stretch">
|
||||||
|
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
||||||
|
|
||||||
|
<span class="md-header-nav__topic">
|
||||||
|
Yq
|
||||||
|
</span>
|
||||||
|
<span class="md-header-nav__topic">
|
||||||
|
Merge
|
||||||
|
</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
|
||||||
|
<label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
|
||||||
|
|
||||||
|
<div class="md-search" data-md-component="search" role="dialog">
|
||||||
|
<label class="md-search__overlay" for="__search"></label>
|
||||||
|
<div class="md-search__inner" role="search">
|
||||||
|
<form class="md-search__form" name="search">
|
||||||
|
<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>
|
||||||
|
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||||
|

|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
<div class="md-search__output">
|
||||||
|
<div class="md-search__scrollwrap" data-md-scrollfix>
|
||||||
|
<div class="md-search-result" data-md-component="result">
|
||||||
|
<div class="md-search-result__meta">
|
||||||
|
Type to start searching
|
||||||
|
</div>
|
||||||
|
<ol class="md-search-result__list"></ol>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
<div class="md-header-nav__source">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://github.com/mikefarah/yq/" title="Go to repository" class="md-source" data-md-source="github">
|
||||||
|
|
||||||
|
<div class="md-source__icon">
|
||||||
|
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||||
|
<use xlink:href="#__github" width="24" height="24"></use>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="md-source__repository">
|
||||||
|
mikefarah/yq
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<div class="md-container">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<main class="md-main">
|
||||||
|
<div class="md-main__inner md-grid" data-md-component="container">
|
||||||
|
|
||||||
|
|
||||||
|
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
|
||||||
|
<div class="md-sidebar__scrollwrap">
|
||||||
|
<div class="md-sidebar__inner">
|
||||||
|
<nav class="md-nav md-nav--primary" data-md-level="0">
|
||||||
|
<label class="md-nav__title md-nav__title--site" for="__drawer">
|
||||||
|
<a href=".." title="Yq" class="md-nav__button md-logo">
|
||||||
|
|
||||||
|
<i class="md-icon"></i>
|
||||||
|
|
||||||
|
</a>
|
||||||
|
Yq
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<div class="md-nav__source">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://github.com/mikefarah/yq/" title="Go to repository" class="md-source" data-md-source="github">
|
||||||
|
|
||||||
|
<div class="md-source__icon">
|
||||||
|
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||||
|
<use xlink:href="#__github" width="24" height="24"></use>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="md-source__repository">
|
||||||
|
mikefarah/yq
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href=".." title="Install" class="md-nav__link">
|
||||||
|
Install
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../read/" title="Read" class="md-nav__link">
|
||||||
|
Read
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../write/" title="Write/Update" class="md-nav__link">
|
||||||
|
Write/Update
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../prefix/" title="Prefix" class="md-nav__link">
|
||||||
|
Prefix
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../delete/" title="Delete" class="md-nav__link">
|
||||||
|
Delete
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../create/" title="Create" class="md-nav__link">
|
||||||
|
Create
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../convert/" title="Convert" class="md-nav__link">
|
||||||
|
Convert
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item md-nav__item--active">
|
||||||
|
|
||||||
|
<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">
|
||||||
|
Merge
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<a href="./" title="Merge" class="md-nav__link md-nav__link--active">
|
||||||
|
Merge
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
<nav class="md-nav md-nav--secondary">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#to-stdout" title="To Stdout" class="md-nav__link">
|
||||||
|
To Stdout
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#updating-files-in-place" title="Updating files in-place" class="md-nav__link">
|
||||||
|
Updating files in-place
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#overwrite-values" title="Overwrite values" class="md-nav__link">
|
||||||
|
Overwrite values
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#overwrite-values-with-arrays" title="Overwrite values with arrays" class="md-nav__link">
|
||||||
|
Overwrite values with arrays
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</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>
|
||||||
|
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
|
||||||
|
<div class="md-sidebar__scrollwrap">
|
||||||
|
<div class="md-sidebar__inner">
|
||||||
|
|
||||||
|
<nav class="md-nav md-nav--secondary">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#to-stdout" title="To Stdout" class="md-nav__link">
|
||||||
|
To Stdout
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#updating-files-in-place" title="Updating files in-place" class="md-nav__link">
|
||||||
|
Updating files in-place
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#overwrite-values" title="Overwrite values" class="md-nav__link">
|
||||||
|
Overwrite values
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#overwrite-values-with-arrays" title="Overwrite values with arrays" class="md-nav__link">
|
||||||
|
Overwrite values with arrays
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</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>
|
||||||
|
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="md-content">
|
||||||
|
<article class="md-content__inner md-typeset">
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://github.com/mikefarah/yq/edit/master/docs/merge.md" title="Edit this page" class="md-icon md-content__icon"></a>
|
||||||
|
|
||||||
|
|
||||||
|
<h1>Merge</h1>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
<pre><code>yq m <yaml_file> <path>...
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
<pre><code class="yaml">a: simple
|
||||||
|
b: [1, 2]
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>and data2.yaml file of:</p>
|
||||||
|
<pre><code class="yaml">a: other
|
||||||
|
c:
|
||||||
|
test: 1
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>then</p>
|
||||||
|
<pre><code class="bash">yq m data1.yaml data2.yaml
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>will output:</p>
|
||||||
|
<pre><code class="yaml">a: simple
|
||||||
|
b: [1, 2]
|
||||||
|
c:
|
||||||
|
test: 1
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<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 data1.yaml file of:</p>
|
||||||
|
<pre><code class="yaml">a: simple
|
||||||
|
b: [1, 2]
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>and data2.yaml file of:</p>
|
||||||
|
<pre><code class="yaml">a: other
|
||||||
|
c:
|
||||||
|
test: 1
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>then</p>
|
||||||
|
<pre><code class="bash">yq m -i data1.yaml data2.yaml
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>will update the data1.yaml file so that the value of 'c' is 'test: 1'.</p>
|
||||||
|
<h3 id="overwrite-values">Overwrite values<a class="headerlink" href="#overwrite-values" title="Permanent link">¶</a></h3>
|
||||||
|
<p>Given a data1.yaml file of:</p>
|
||||||
|
<pre><code class="yaml">a: simple
|
||||||
|
b: [1, 2]
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>and data2.yaml file of:</p>
|
||||||
|
<pre><code class="yaml">a: other
|
||||||
|
c:
|
||||||
|
test: 1
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>then</p>
|
||||||
|
<pre><code class="bash">yq m -x data1.yaml data2.yaml
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>will output:</p>
|
||||||
|
<pre><code class="yaml">a: other
|
||||||
|
b: [1, 2]
|
||||||
|
c:
|
||||||
|
test: 1
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<h3 id="overwrite-values-with-arrays">Overwrite values with arrays<a class="headerlink" href="#overwrite-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]
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>and data3.yaml file of:</p>
|
||||||
|
<pre><code class="yaml">b: [3, 4]
|
||||||
|
c:
|
||||||
|
test: 2
|
||||||
|
other: true
|
||||||
|
d: false
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>then</p>
|
||||||
|
<pre><code class="bash">yq m -x data1.yaml data3.yaml
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>will output:</p>
|
||||||
|
<pre><code class="yaml">a: simple
|
||||||
|
b: [3, 4]
|
||||||
|
c:
|
||||||
|
test: 2
|
||||||
|
other: true
|
||||||
|
d: false
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>Notice that 'b' does not result in the merging of the 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>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
|
||||||
|
<footer class="md-footer">
|
||||||
|
|
||||||
|
<div class="md-footer-nav">
|
||||||
|
<nav class="md-footer-nav__inner md-grid">
|
||||||
|
|
||||||
|
<a href="../convert/" title="Convert" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
|
||||||
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
<i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
|
||||||
|
</div>
|
||||||
|
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
|
||||||
|
<span class="md-flex__ellipsis">
|
||||||
|
<span class="md-footer-nav__direction">
|
||||||
|
Previous
|
||||||
|
</span>
|
||||||
|
Convert
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="md-footer-meta md-typeset">
|
||||||
|
<div class="md-footer-meta__inner md-grid">
|
||||||
|
<div class="md-footer-copyright">
|
||||||
|
|
||||||
|
powered by
|
||||||
|
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||||
|
and
|
||||||
|
<a href="https://squidfunk.github.io/mkdocs-material/">
|
||||||
|
Material for MkDocs</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="md-footer-social">
|
||||||
|
<link rel="stylesheet" href="../assets/fonts/font-awesome.css">
|
||||||
|
|
||||||
|
<a href="https://github.com/mikefarah" class="md-footer-social__link fa fa-github"></a>
|
||||||
|
|
||||||
|
<a href="https://www.linkedin.com/in/mike-farah-b5a75b2/" class="md-footer-social__link fa fa-linkedin"></a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="../assets/javascripts/application.39abc4af.js"></script>
|
||||||
|
|
||||||
|
<script>app.initialize({version:"1.0.4",url:{base:".."}})</script>
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
7
docs/mkdocs/js/lunr.min.js
vendored
1
docs/mkdocs/js/mustache.min.js
vendored
@@ -1,36 +0,0 @@
|
|||||||
/*
|
|
||||||
RequireJS 2.1.16 Copyright (c) 2010-2015, The Dojo Foundation All Rights Reserved.
|
|
||||||
Available via the MIT or new BSD license.
|
|
||||||
see: http://github.com/jrburke/requirejs for details
|
|
||||||
*/
|
|
||||||
var requirejs,require,define;
|
|
||||||
(function(ba){function G(b){return"[object Function]"===K.call(b)}function H(b){return"[object Array]"===K.call(b)}function v(b,c){if(b){var d;for(d=0;d<b.length&&(!b[d]||!c(b[d],d,b));d+=1);}}function T(b,c){if(b){var d;for(d=b.length-1;-1<d&&(!b[d]||!c(b[d],d,b));d-=1);}}function t(b,c){return fa.call(b,c)}function m(b,c){return t(b,c)&&b[c]}function B(b,c){for(var d in b)if(t(b,d)&&c(b[d],d))break}function U(b,c,d,e){c&&B(c,function(c,g){if(d||!t(b,g))e&&"object"===typeof c&&c&&!H(c)&&!G(c)&&!(c instanceof
|
|
||||||
RegExp)?(b[g]||(b[g]={}),U(b[g],c,d,e)):b[g]=c});return b}function u(b,c){return function(){return c.apply(b,arguments)}}function ca(b){throw b;}function da(b){if(!b)return b;var c=ba;v(b.split("."),function(b){c=c[b]});return c}function C(b,c,d,e){c=Error(c+"\nhttp://requirejs.org/docs/errors.html#"+b);c.requireType=b;c.requireModules=e;d&&(c.originalError=d);return c}function ga(b){function c(a,k,b){var f,l,c,d,e,g,i,p,k=k&&k.split("/"),h=j.map,n=h&&h["*"];if(a){a=a.split("/");l=a.length-1;j.nodeIdCompat&&
|
|
||||||
Q.test(a[l])&&(a[l]=a[l].replace(Q,""));"."===a[0].charAt(0)&&k&&(l=k.slice(0,k.length-1),a=l.concat(a));l=a;for(c=0;c<l.length;c++)if(d=l[c],"."===d)l.splice(c,1),c-=1;else if(".."===d&&!(0===c||1==c&&".."===l[2]||".."===l[c-1])&&0<c)l.splice(c-1,2),c-=2;a=a.join("/")}if(b&&h&&(k||n)){l=a.split("/");c=l.length;a:for(;0<c;c-=1){e=l.slice(0,c).join("/");if(k)for(d=k.length;0<d;d-=1)if(b=m(h,k.slice(0,d).join("/")))if(b=m(b,e)){f=b;g=c;break a}!i&&(n&&m(n,e))&&(i=m(n,e),p=c)}!f&&i&&(f=i,g=p);f&&(l.splice(0,
|
|
||||||
g,f),a=l.join("/"))}return(f=m(j.pkgs,a))?f:a}function d(a){z&&v(document.getElementsByTagName("script"),function(k){if(k.getAttribute("data-requiremodule")===a&&k.getAttribute("data-requirecontext")===i.contextName)return k.parentNode.removeChild(k),!0})}function e(a){var k=m(j.paths,a);if(k&&H(k)&&1<k.length)return k.shift(),i.require.undef(a),i.makeRequire(null,{skipMap:!0})([a]),!0}function n(a){var k,c=a?a.indexOf("!"):-1;-1<c&&(k=a.substring(0,c),a=a.substring(c+1,a.length));return[k,a]}function p(a,
|
|
||||||
k,b,f){var l,d,e=null,g=k?k.name:null,j=a,p=!0,h="";a||(p=!1,a="_@r"+(K+=1));a=n(a);e=a[0];a=a[1];e&&(e=c(e,g,f),d=m(r,e));a&&(e?h=d&&d.normalize?d.normalize(a,function(a){return c(a,g,f)}):-1===a.indexOf("!")?c(a,g,f):a:(h=c(a,g,f),a=n(h),e=a[0],h=a[1],b=!0,l=i.nameToUrl(h)));b=e&&!d&&!b?"_unnormalized"+(O+=1):"";return{prefix:e,name:h,parentMap:k,unnormalized:!!b,url:l,originalName:j,isDefine:p,id:(e?e+"!"+h:h)+b}}function s(a){var k=a.id,b=m(h,k);b||(b=h[k]=new i.Module(a));return b}function q(a,
|
|
||||||
k,b){var f=a.id,c=m(h,f);if(t(r,f)&&(!c||c.defineEmitComplete))"defined"===k&&b(r[f]);else if(c=s(a),c.error&&"error"===k)b(c.error);else c.on(k,b)}function w(a,b){var c=a.requireModules,f=!1;if(b)b(a);else if(v(c,function(b){if(b=m(h,b))b.error=a,b.events.error&&(f=!0,b.emit("error",a))}),!f)g.onError(a)}function x(){R.length&&(ha.apply(A,[A.length,0].concat(R)),R=[])}function y(a){delete h[a];delete V[a]}function F(a,b,c){var f=a.map.id;a.error?a.emit("error",a.error):(b[f]=!0,v(a.depMaps,function(f,
|
|
||||||
d){var e=f.id,g=m(h,e);g&&(!a.depMatched[d]&&!c[e])&&(m(b,e)?(a.defineDep(d,r[e]),a.check()):F(g,b,c))}),c[f]=!0)}function D(){var a,b,c=(a=1E3*j.waitSeconds)&&i.startTime+a<(new Date).getTime(),f=[],l=[],g=!1,h=!0;if(!W){W=!0;B(V,function(a){var i=a.map,j=i.id;if(a.enabled&&(i.isDefine||l.push(a),!a.error))if(!a.inited&&c)e(j)?g=b=!0:(f.push(j),d(j));else if(!a.inited&&(a.fetched&&i.isDefine)&&(g=!0,!i.prefix))return h=!1});if(c&&f.length)return a=C("timeout","Load timeout for modules: "+f,null,
|
|
||||||
f),a.contextName=i.contextName,w(a);h&&v(l,function(a){F(a,{},{})});if((!c||b)&&g)if((z||ea)&&!X)X=setTimeout(function(){X=0;D()},50);W=!1}}function E(a){t(r,a[0])||s(p(a[0],null,!0)).init(a[1],a[2])}function I(a){var a=a.currentTarget||a.srcElement,b=i.onScriptLoad;a.detachEvent&&!Y?a.detachEvent("onreadystatechange",b):a.removeEventListener("load",b,!1);b=i.onScriptError;(!a.detachEvent||Y)&&a.removeEventListener("error",b,!1);return{node:a,id:a&&a.getAttribute("data-requiremodule")}}function J(){var a;
|
|
||||||
for(x();A.length;){a=A.shift();if(null===a[0])return w(C("mismatch","Mismatched anonymous define() module: "+a[a.length-1]));E(a)}}var W,Z,i,L,X,j={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},h={},V={},$={},A=[],r={},S={},aa={},K=1,O=1;L={require:function(a){return a.require?a.require:a.require=i.makeRequire(a.map)},exports:function(a){a.usingExports=!0;if(a.map.isDefine)return a.exports?r[a.map.id]=a.exports:a.exports=r[a.map.id]={}},module:function(a){return a.module?
|
|
||||||
a.module:a.module={id:a.map.id,uri:a.map.url,config:function(){return m(j.config,a.map.id)||{}},exports:a.exports||(a.exports={})}}};Z=function(a){this.events=m($,a.id)||{};this.map=a;this.shim=m(j.shim,a.id);this.depExports=[];this.depMaps=[];this.depMatched=[];this.pluginMaps={};this.depCount=0};Z.prototype={init:function(a,b,c,f){f=f||{};if(!this.inited){this.factory=b;if(c)this.on("error",c);else this.events.error&&(c=u(this,function(a){this.emit("error",a)}));this.depMaps=a&&a.slice(0);this.errback=
|
|
||||||
c;this.inited=!0;this.ignore=f.ignore;f.enabled||this.enabled?this.enable():this.check()}},defineDep:function(a,b){this.depMatched[a]||(this.depMatched[a]=!0,this.depCount-=1,this.depExports[a]=b)},fetch:function(){if(!this.fetched){this.fetched=!0;i.startTime=(new Date).getTime();var a=this.map;if(this.shim)i.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],u(this,function(){return a.prefix?this.callPlugin():this.load()}));else return a.prefix?this.callPlugin():this.load()}},load:function(){var a=
|
|
||||||
this.map.url;S[a]||(S[a]=!0,i.load(this.map.id,a))},check:function(){if(this.enabled&&!this.enabling){var a,b,c=this.map.id;b=this.depExports;var f=this.exports,l=this.factory;if(this.inited)if(this.error)this.emit("error",this.error);else{if(!this.defining){this.defining=!0;if(1>this.depCount&&!this.defined){if(G(l)){if(this.events.error&&this.map.isDefine||g.onError!==ca)try{f=i.execCb(c,l,b,f)}catch(d){a=d}else f=i.execCb(c,l,b,f);this.map.isDefine&&void 0===f&&((b=this.module)?f=b.exports:this.usingExports&&
|
|
||||||
(f=this.exports));if(a)return a.requireMap=this.map,a.requireModules=this.map.isDefine?[this.map.id]:null,a.requireType=this.map.isDefine?"define":"require",w(this.error=a)}else f=l;this.exports=f;if(this.map.isDefine&&!this.ignore&&(r[c]=f,g.onResourceLoad))g.onResourceLoad(i,this.map,this.depMaps);y(c);this.defined=!0}this.defining=!1;this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else this.fetch()}},callPlugin:function(){var a=
|
|
||||||
this.map,b=a.id,d=p(a.prefix);this.depMaps.push(d);q(d,"defined",u(this,function(f){var l,d;d=m(aa,this.map.id);var e=this.map.name,P=this.map.parentMap?this.map.parentMap.name:null,n=i.makeRequire(a.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){if(f.normalize&&(e=f.normalize(e,function(a){return c(a,P,!0)})||""),f=p(a.prefix+"!"+e,this.map.parentMap),q(f,"defined",u(this,function(a){this.init([],function(){return a},null,{enabled:!0,ignore:!0})})),d=m(h,f.id)){this.depMaps.push(f);
|
|
||||||
if(this.events.error)d.on("error",u(this,function(a){this.emit("error",a)}));d.enable()}}else d?(this.map.url=i.nameToUrl(d),this.load()):(l=u(this,function(a){this.init([],function(){return a},null,{enabled:!0})}),l.error=u(this,function(a){this.inited=!0;this.error=a;a.requireModules=[b];B(h,function(a){0===a.map.id.indexOf(b+"_unnormalized")&&y(a.map.id)});w(a)}),l.fromText=u(this,function(f,c){var d=a.name,e=p(d),P=M;c&&(f=c);P&&(M=!1);s(e);t(j.config,b)&&(j.config[d]=j.config[b]);try{g.exec(f)}catch(h){return w(C("fromtexteval",
|
|
||||||
"fromText eval for "+b+" failed: "+h,h,[b]))}P&&(M=!0);this.depMaps.push(e);i.completeLoad(d);n([d],l)}),f.load(a.name,n,l,j))}));i.enable(d,this);this.pluginMaps[d.id]=d},enable:function(){V[this.map.id]=this;this.enabling=this.enabled=!0;v(this.depMaps,u(this,function(a,b){var c,f;if("string"===typeof a){a=p(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap);this.depMaps[b]=a;if(c=m(L,a.id)){this.depExports[b]=c(this);return}this.depCount+=1;q(a,"defined",u(this,function(a){this.defineDep(b,
|
|
||||||
a);this.check()}));this.errback?q(a,"error",u(this,this.errback)):this.events.error&&q(a,"error",u(this,function(a){this.emit("error",a)}))}c=a.id;f=h[c];!t(L,c)&&(f&&!f.enabled)&&i.enable(a,this)}));B(this.pluginMaps,u(this,function(a){var b=m(h,a.id);b&&!b.enabled&&i.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c=this.events[a];c||(c=this.events[a]=[]);c.push(b)},emit:function(a,b){v(this.events[a],function(a){a(b)});"error"===a&&delete this.events[a]}};i={config:j,contextName:b,
|
|
||||||
registry:h,defined:r,urlFetched:S,defQueue:A,Module:Z,makeModuleMap:p,nextTick:g.nextTick,onError:w,configure:function(a){a.baseUrl&&"/"!==a.baseUrl.charAt(a.baseUrl.length-1)&&(a.baseUrl+="/");var b=j.shim,c={paths:!0,bundles:!0,config:!0,map:!0};B(a,function(a,b){c[b]?(j[b]||(j[b]={}),U(j[b],a,!0,!0)):j[b]=a});a.bundles&&B(a.bundles,function(a,b){v(a,function(a){a!==b&&(aa[a]=b)})});a.shim&&(B(a.shim,function(a,c){H(a)&&(a={deps:a});if((a.exports||a.init)&&!a.exportsFn)a.exportsFn=i.makeShimExports(a);
|
|
||||||
b[c]=a}),j.shim=b);a.packages&&v(a.packages,function(a){var b,a="string"===typeof a?{name:a}:a;b=a.name;a.location&&(j.paths[b]=a.location);j.pkgs[b]=a.name+"/"+(a.main||"main").replace(ia,"").replace(Q,"")});B(h,function(a,b){!a.inited&&!a.map.unnormalized&&(a.map=p(b))});if(a.deps||a.callback)i.require(a.deps||[],a.callback)},makeShimExports:function(a){return function(){var b;a.init&&(b=a.init.apply(ba,arguments));return b||a.exports&&da(a.exports)}},makeRequire:function(a,e){function j(c,d,m){var n,
|
|
||||||
q;e.enableBuildCallback&&(d&&G(d))&&(d.__requireJsBuild=!0);if("string"===typeof c){if(G(d))return w(C("requireargs","Invalid require call"),m);if(a&&t(L,c))return L[c](h[a.id]);if(g.get)return g.get(i,c,a,j);n=p(c,a,!1,!0);n=n.id;return!t(r,n)?w(C("notloaded",'Module name "'+n+'" has not been loaded yet for context: '+b+(a?"":". Use require([])"))):r[n]}J();i.nextTick(function(){J();q=s(p(null,a));q.skipMap=e.skipMap;q.init(c,d,m,{enabled:!0});D()});return j}e=e||{};U(j,{isBrowser:z,toUrl:function(b){var d,
|
|
||||||
e=b.lastIndexOf("."),k=b.split("/")[0];if(-1!==e&&(!("."===k||".."===k)||1<e))d=b.substring(e,b.length),b=b.substring(0,e);return i.nameToUrl(c(b,a&&a.id,!0),d,!0)},defined:function(b){return t(r,p(b,a,!1,!0).id)},specified:function(b){b=p(b,a,!1,!0).id;return t(r,b)||t(h,b)}});a||(j.undef=function(b){x();var c=p(b,a,!0),e=m(h,b);d(b);delete r[b];delete S[c.url];delete $[b];T(A,function(a,c){a[0]===b&&A.splice(c,1)});e&&(e.events.defined&&($[b]=e.events),y(b))});return j},enable:function(a){m(h,a.id)&&
|
|
||||||
s(a).enable()},completeLoad:function(a){var b,c,d=m(j.shim,a)||{},g=d.exports;for(x();A.length;){c=A.shift();if(null===c[0]){c[0]=a;if(b)break;b=!0}else c[0]===a&&(b=!0);E(c)}c=m(h,a);if(!b&&!t(r,a)&&c&&!c.inited){if(j.enforceDefine&&(!g||!da(g)))return e(a)?void 0:w(C("nodefine","No define call for "+a,null,[a]));E([a,d.deps||[],d.exportsFn])}D()},nameToUrl:function(a,b,c){var d,e,h;(d=m(j.pkgs,a))&&(a=d);if(d=m(aa,a))return i.nameToUrl(d,b,c);if(g.jsExtRegExp.test(a))d=a+(b||"");else{d=j.paths;
|
|
||||||
a=a.split("/");for(e=a.length;0<e;e-=1)if(h=a.slice(0,e).join("/"),h=m(d,h)){H(h)&&(h=h[0]);a.splice(0,e,h);break}d=a.join("/");d+=b||(/^data\:|\?/.test(d)||c?"":".js");d=("/"===d.charAt(0)||d.match(/^[\w\+\.\-]+:/)?"":j.baseUrl)+d}return j.urlArgs?d+((-1===d.indexOf("?")?"?":"&")+j.urlArgs):d},load:function(a,b){g.load(i,a,b)},execCb:function(a,b,c,d){return b.apply(d,c)},onScriptLoad:function(a){if("load"===a.type||ja.test((a.currentTarget||a.srcElement).readyState))N=null,a=I(a),i.completeLoad(a.id)},
|
|
||||||
onScriptError:function(a){var b=I(a);if(!e(b.id))return w(C("scripterror","Script error for: "+b.id,a,[b.id]))}};i.require=i.makeRequire();return i}var g,x,y,D,I,E,N,J,s,O,ka=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,la=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,Q=/\.js$/,ia=/^\.\//;x=Object.prototype;var K=x.toString,fa=x.hasOwnProperty,ha=Array.prototype.splice,z=!!("undefined"!==typeof window&&"undefined"!==typeof navigator&&window.document),ea=!z&&"undefined"!==typeof importScripts,ja=
|
|
||||||
z&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,Y="undefined"!==typeof opera&&"[object Opera]"===opera.toString(),F={},q={},R=[],M=!1;if("undefined"===typeof define){if("undefined"!==typeof requirejs){if(G(requirejs))return;q=requirejs;requirejs=void 0}"undefined"!==typeof require&&!G(require)&&(q=require,require=void 0);g=requirejs=function(b,c,d,e){var n,p="_";!H(b)&&"string"!==typeof b&&(n=b,H(c)?(b=c,c=d,d=e):b=[]);n&&n.context&&(p=n.context);(e=m(F,p))||(e=F[p]=g.s.newContext(p));
|
|
||||||
n&&e.configure(n);return e.require(b,c,d)};g.config=function(b){return g(b)};g.nextTick="undefined"!==typeof setTimeout?function(b){setTimeout(b,4)}:function(b){b()};require||(require=g);g.version="2.1.16";g.jsExtRegExp=/^\/|:|\?|\.js$/;g.isBrowser=z;x=g.s={contexts:F,newContext:ga};g({});v(["toUrl","undef","defined","specified"],function(b){g[b]=function(){var c=F._;return c.require[b].apply(c,arguments)}});if(z&&(y=x.head=document.getElementsByTagName("head")[0],D=document.getElementsByTagName("base")[0]))y=
|
|
||||||
x.head=D.parentNode;g.onError=ca;g.createNode=function(b){var c=b.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");c.type=b.scriptType||"text/javascript";c.charset="utf-8";c.async=!0;return c};g.load=function(b,c,d){var e=b&&b.config||{};if(z)return e=g.createNode(e,c,d),e.setAttribute("data-requirecontext",b.contextName),e.setAttribute("data-requiremodule",c),e.attachEvent&&!(e.attachEvent.toString&&0>e.attachEvent.toString().indexOf("[native code"))&&
|
|
||||||
!Y?(M=!0,e.attachEvent("onreadystatechange",b.onScriptLoad)):(e.addEventListener("load",b.onScriptLoad,!1),e.addEventListener("error",b.onScriptError,!1)),e.src=d,J=e,D?y.insertBefore(e,D):y.appendChild(e),J=null,e;if(ea)try{importScripts(d),b.completeLoad(c)}catch(m){b.onError(C("importscripts","importScripts failed for "+c+" at "+d,m,[c]))}};z&&!q.skipDataMain&&T(document.getElementsByTagName("script"),function(b){y||(y=b.parentNode);if(I=b.getAttribute("data-main"))return s=I,q.baseUrl||(E=s.split("/"),
|
|
||||||
s=E.pop(),O=E.length?E.join("/")+"/":"./",q.baseUrl=O),s=s.replace(Q,""),g.jsExtRegExp.test(s)&&(s=I),q.deps=q.deps?q.deps.concat(s):[s],!0});define=function(b,c,d){var e,g;"string"!==typeof b&&(d=c,c=b,b=null);H(c)||(d=c,c=null);!c&&G(d)&&(c=[],d.length&&(d.toString().replace(ka,"").replace(la,function(b,d){c.push(d)}),c=(1===d.length?["require"]:["require","exports","module"]).concat(c)));if(M){if(!(e=J))N&&"interactive"===N.readyState||T(document.getElementsByTagName("script"),function(b){if("interactive"===
|
|
||||||
b.readyState)return N=b}),e=N;e&&(b||(b=e.getAttribute("data-requiremodule")),g=F[e.getAttribute("data-requirecontext")])}(g?g.defQueue:R).push([b,c,d])};define.amd={jQuery:!0};g.exec=function(b){return eval(b)};g(q)}})(this);
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
<article>
|
|
||||||
<h3><a href="{{location}}">{{title}}</a></h3>
|
|
||||||
<p>{{summary}}</p>
|
|
||||||
</article>
|
|
||||||
@@ -1,88 +0,0 @@
|
|||||||
require([
|
|
||||||
base_url + '/mkdocs/js/mustache.min.js',
|
|
||||||
base_url + '/mkdocs/js/lunr.min.js',
|
|
||||||
'text!search-results-template.mustache',
|
|
||||||
'text!../search_index.json',
|
|
||||||
], function (Mustache, lunr, results_template, data) {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
function getSearchTerm()
|
|
||||||
{
|
|
||||||
var sPageURL = window.location.search.substring(1);
|
|
||||||
var sURLVariables = sPageURL.split('&');
|
|
||||||
for (var i = 0; i < sURLVariables.length; i++)
|
|
||||||
{
|
|
||||||
var sParameterName = sURLVariables[i].split('=');
|
|
||||||
if (sParameterName[0] == 'q')
|
|
||||||
{
|
|
||||||
return decodeURIComponent(sParameterName[1].replace(/\+/g, '%20'));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var index = lunr(function () {
|
|
||||||
this.field('title', {boost: 10});
|
|
||||||
this.field('text');
|
|
||||||
this.ref('location');
|
|
||||||
});
|
|
||||||
|
|
||||||
data = JSON.parse(data);
|
|
||||||
var documents = {};
|
|
||||||
|
|
||||||
for (var i=0; i < data.docs.length; i++){
|
|
||||||
var doc = data.docs[i];
|
|
||||||
doc.location = base_url + doc.location;
|
|
||||||
index.add(doc);
|
|
||||||
documents[doc.location] = doc;
|
|
||||||
}
|
|
||||||
|
|
||||||
var search = function(){
|
|
||||||
|
|
||||||
var query = document.getElementById('mkdocs-search-query').value;
|
|
||||||
var search_results = document.getElementById("mkdocs-search-results");
|
|
||||||
while (search_results.firstChild) {
|
|
||||||
search_results.removeChild(search_results.firstChild);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(query === ''){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var results = index.search(query);
|
|
||||||
|
|
||||||
if (results.length > 0){
|
|
||||||
for (var i=0; i < results.length; i++){
|
|
||||||
var result = results[i];
|
|
||||||
doc = documents[result.ref];
|
|
||||||
doc.base_url = base_url;
|
|
||||||
doc.summary = doc.text.substring(0, 200);
|
|
||||||
var html = Mustache.to_html(results_template, doc);
|
|
||||||
search_results.insertAdjacentHTML('beforeend', html);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
search_results.insertAdjacentHTML('beforeend', "<p>No results found</p>");
|
|
||||||
}
|
|
||||||
|
|
||||||
if(jQuery){
|
|
||||||
/*
|
|
||||||
* We currently only automatically hide bootstrap models. This
|
|
||||||
* requires jQuery to work.
|
|
||||||
*/
|
|
||||||
jQuery('#mkdocs_search_modal a').click(function(){
|
|
||||||
jQuery('#mkdocs_search_modal').modal('hide');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
var search_input = document.getElementById('mkdocs-search-query');
|
|
||||||
|
|
||||||
var term = getSearchTerm();
|
|
||||||
if (term){
|
|
||||||
search_input.value = term;
|
|
||||||
search();
|
|
||||||
}
|
|
||||||
|
|
||||||
search_input.addEventListener("keyup", search);
|
|
||||||
|
|
||||||
});
|
|
||||||
@@ -1,390 +0,0 @@
|
|||||||
/**
|
|
||||||
* @license RequireJS text 2.0.12 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
|
|
||||||
* Available via the MIT or new BSD license.
|
|
||||||
* see: http://github.com/requirejs/text for details
|
|
||||||
*/
|
|
||||||
/*jslint regexp: true */
|
|
||||||
/*global require, XMLHttpRequest, ActiveXObject,
|
|
||||||
define, window, process, Packages,
|
|
||||||
java, location, Components, FileUtils */
|
|
||||||
|
|
||||||
define(['module'], function (module) {
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
var text, fs, Cc, Ci, xpcIsWindows,
|
|
||||||
progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'],
|
|
||||||
xmlRegExp = /^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,
|
|
||||||
bodyRegExp = /<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,
|
|
||||||
hasLocation = typeof location !== 'undefined' && location.href,
|
|
||||||
defaultProtocol = hasLocation && location.protocol && location.protocol.replace(/\:/, ''),
|
|
||||||
defaultHostName = hasLocation && location.hostname,
|
|
||||||
defaultPort = hasLocation && (location.port || undefined),
|
|
||||||
buildMap = {},
|
|
||||||
masterConfig = (module.config && module.config()) || {};
|
|
||||||
|
|
||||||
text = {
|
|
||||||
version: '2.0.12',
|
|
||||||
|
|
||||||
strip: function (content) {
|
|
||||||
//Strips <?xml ...?> declarations so that external SVG and XML
|
|
||||||
//documents can be added to a document without worry. Also, if the string
|
|
||||||
//is an HTML document, only the part inside the body tag is returned.
|
|
||||||
if (content) {
|
|
||||||
content = content.replace(xmlRegExp, "");
|
|
||||||
var matches = content.match(bodyRegExp);
|
|
||||||
if (matches) {
|
|
||||||
content = matches[1];
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
content = "";
|
|
||||||
}
|
|
||||||
return content;
|
|
||||||
},
|
|
||||||
|
|
||||||
jsEscape: function (content) {
|
|
||||||
return content.replace(/(['\\])/g, '\\$1')
|
|
||||||
.replace(/[\f]/g, "\\f")
|
|
||||||
.replace(/[\b]/g, "\\b")
|
|
||||||
.replace(/[\n]/g, "\\n")
|
|
||||||
.replace(/[\t]/g, "\\t")
|
|
||||||
.replace(/[\r]/g, "\\r")
|
|
||||||
.replace(/[\u2028]/g, "\\u2028")
|
|
||||||
.replace(/[\u2029]/g, "\\u2029");
|
|
||||||
},
|
|
||||||
|
|
||||||
createXhr: masterConfig.createXhr || function () {
|
|
||||||
//Would love to dump the ActiveX crap in here. Need IE 6 to die first.
|
|
||||||
var xhr, i, progId;
|
|
||||||
if (typeof XMLHttpRequest !== "undefined") {
|
|
||||||
return new XMLHttpRequest();
|
|
||||||
} else if (typeof ActiveXObject !== "undefined") {
|
|
||||||
for (i = 0; i < 3; i += 1) {
|
|
||||||
progId = progIds[i];
|
|
||||||
try {
|
|
||||||
xhr = new ActiveXObject(progId);
|
|
||||||
} catch (e) {}
|
|
||||||
|
|
||||||
if (xhr) {
|
|
||||||
progIds = [progId]; // so faster next time
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return xhr;
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Parses a resource name into its component parts. Resource names
|
|
||||||
* look like: module/name.ext!strip, where the !strip part is
|
|
||||||
* optional.
|
|
||||||
* @param {String} name the resource name
|
|
||||||
* @returns {Object} with properties "moduleName", "ext" and "strip"
|
|
||||||
* where strip is a boolean.
|
|
||||||
*/
|
|
||||||
parseName: function (name) {
|
|
||||||
var modName, ext, temp,
|
|
||||||
strip = false,
|
|
||||||
index = name.indexOf("."),
|
|
||||||
isRelative = name.indexOf('./') === 0 ||
|
|
||||||
name.indexOf('../') === 0;
|
|
||||||
|
|
||||||
if (index !== -1 && (!isRelative || index > 1)) {
|
|
||||||
modName = name.substring(0, index);
|
|
||||||
ext = name.substring(index + 1, name.length);
|
|
||||||
} else {
|
|
||||||
modName = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
temp = ext || modName;
|
|
||||||
index = temp.indexOf("!");
|
|
||||||
if (index !== -1) {
|
|
||||||
//Pull off the strip arg.
|
|
||||||
strip = temp.substring(index + 1) === "strip";
|
|
||||||
temp = temp.substring(0, index);
|
|
||||||
if (ext) {
|
|
||||||
ext = temp;
|
|
||||||
} else {
|
|
||||||
modName = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
moduleName: modName,
|
|
||||||
ext: ext,
|
|
||||||
strip: strip
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
xdRegExp: /^((\w+)\:)?\/\/([^\/\\]+)/,
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Is an URL on another domain. Only works for browser use, returns
|
|
||||||
* false in non-browser environments. Only used to know if an
|
|
||||||
* optimized .js version of a text resource should be loaded
|
|
||||||
* instead.
|
|
||||||
* @param {String} url
|
|
||||||
* @returns Boolean
|
|
||||||
*/
|
|
||||||
useXhr: function (url, protocol, hostname, port) {
|
|
||||||
var uProtocol, uHostName, uPort,
|
|
||||||
match = text.xdRegExp.exec(url);
|
|
||||||
if (!match) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
uProtocol = match[2];
|
|
||||||
uHostName = match[3];
|
|
||||||
|
|
||||||
uHostName = uHostName.split(':');
|
|
||||||
uPort = uHostName[1];
|
|
||||||
uHostName = uHostName[0];
|
|
||||||
|
|
||||||
return (!uProtocol || uProtocol === protocol) &&
|
|
||||||
(!uHostName || uHostName.toLowerCase() === hostname.toLowerCase()) &&
|
|
||||||
((!uPort && !uHostName) || uPort === port);
|
|
||||||
},
|
|
||||||
|
|
||||||
finishLoad: function (name, strip, content, onLoad) {
|
|
||||||
content = strip ? text.strip(content) : content;
|
|
||||||
if (masterConfig.isBuild) {
|
|
||||||
buildMap[name] = content;
|
|
||||||
}
|
|
||||||
onLoad(content);
|
|
||||||
},
|
|
||||||
|
|
||||||
load: function (name, req, onLoad, config) {
|
|
||||||
//Name has format: some.module.filext!strip
|
|
||||||
//The strip part is optional.
|
|
||||||
//if strip is present, then that means only get the string contents
|
|
||||||
//inside a body tag in an HTML string. For XML/SVG content it means
|
|
||||||
//removing the <?xml ...?> declarations so the content can be inserted
|
|
||||||
//into the current doc without problems.
|
|
||||||
|
|
||||||
// Do not bother with the work if a build and text will
|
|
||||||
// not be inlined.
|
|
||||||
if (config && config.isBuild && !config.inlineText) {
|
|
||||||
onLoad();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
masterConfig.isBuild = config && config.isBuild;
|
|
||||||
|
|
||||||
var parsed = text.parseName(name),
|
|
||||||
nonStripName = parsed.moduleName +
|
|
||||||
(parsed.ext ? '.' + parsed.ext : ''),
|
|
||||||
url = req.toUrl(nonStripName),
|
|
||||||
useXhr = (masterConfig.useXhr) ||
|
|
||||||
text.useXhr;
|
|
||||||
|
|
||||||
// Do not load if it is an empty: url
|
|
||||||
if (url.indexOf('empty:') === 0) {
|
|
||||||
onLoad();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Load the text. Use XHR if possible and in a browser.
|
|
||||||
if (!hasLocation || useXhr(url, defaultProtocol, defaultHostName, defaultPort)) {
|
|
||||||
text.get(url, function (content) {
|
|
||||||
text.finishLoad(name, parsed.strip, content, onLoad);
|
|
||||||
}, function (err) {
|
|
||||||
if (onLoad.error) {
|
|
||||||
onLoad.error(err);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
//Need to fetch the resource across domains. Assume
|
|
||||||
//the resource has been optimized into a JS module. Fetch
|
|
||||||
//by the module name + extension, but do not include the
|
|
||||||
//!strip part to avoid file system issues.
|
|
||||||
req([nonStripName], function (content) {
|
|
||||||
text.finishLoad(parsed.moduleName + '.' + parsed.ext,
|
|
||||||
parsed.strip, content, onLoad);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
write: function (pluginName, moduleName, write, config) {
|
|
||||||
if (buildMap.hasOwnProperty(moduleName)) {
|
|
||||||
var content = text.jsEscape(buildMap[moduleName]);
|
|
||||||
write.asModule(pluginName + "!" + moduleName,
|
|
||||||
"define(function () { return '" +
|
|
||||||
content +
|
|
||||||
"';});\n");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
writeFile: function (pluginName, moduleName, req, write, config) {
|
|
||||||
var parsed = text.parseName(moduleName),
|
|
||||||
extPart = parsed.ext ? '.' + parsed.ext : '',
|
|
||||||
nonStripName = parsed.moduleName + extPart,
|
|
||||||
//Use a '.js' file name so that it indicates it is a
|
|
||||||
//script that can be loaded across domains.
|
|
||||||
fileName = req.toUrl(parsed.moduleName + extPart) + '.js';
|
|
||||||
|
|
||||||
//Leverage own load() method to load plugin value, but only
|
|
||||||
//write out values that do not have the strip argument,
|
|
||||||
//to avoid any potential issues with ! in file names.
|
|
||||||
text.load(nonStripName, req, function (value) {
|
|
||||||
//Use own write() method to construct full module value.
|
|
||||||
//But need to create shell that translates writeFile's
|
|
||||||
//write() to the right interface.
|
|
||||||
var textWrite = function (contents) {
|
|
||||||
return write(fileName, contents);
|
|
||||||
};
|
|
||||||
textWrite.asModule = function (moduleName, contents) {
|
|
||||||
return write.asModule(moduleName, fileName, contents);
|
|
||||||
};
|
|
||||||
|
|
||||||
text.write(pluginName, nonStripName, textWrite, config);
|
|
||||||
}, config);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
if (masterConfig.env === 'node' || (!masterConfig.env &&
|
|
||||||
typeof process !== "undefined" &&
|
|
||||||
process.versions &&
|
|
||||||
!!process.versions.node &&
|
|
||||||
!process.versions['node-webkit'])) {
|
|
||||||
//Using special require.nodeRequire, something added by r.js.
|
|
||||||
fs = require.nodeRequire('fs');
|
|
||||||
|
|
||||||
text.get = function (url, callback, errback) {
|
|
||||||
try {
|
|
||||||
var file = fs.readFileSync(url, 'utf8');
|
|
||||||
//Remove BOM (Byte Mark Order) from utf8 files if it is there.
|
|
||||||
if (file.indexOf('\uFEFF') === 0) {
|
|
||||||
file = file.substring(1);
|
|
||||||
}
|
|
||||||
callback(file);
|
|
||||||
} catch (e) {
|
|
||||||
if (errback) {
|
|
||||||
errback(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
} else if (masterConfig.env === 'xhr' || (!masterConfig.env &&
|
|
||||||
text.createXhr())) {
|
|
||||||
text.get = function (url, callback, errback, headers) {
|
|
||||||
var xhr = text.createXhr(), header;
|
|
||||||
xhr.open('GET', url, true);
|
|
||||||
|
|
||||||
//Allow plugins direct access to xhr headers
|
|
||||||
if (headers) {
|
|
||||||
for (header in headers) {
|
|
||||||
if (headers.hasOwnProperty(header)) {
|
|
||||||
xhr.setRequestHeader(header.toLowerCase(), headers[header]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Allow overrides specified in config
|
|
||||||
if (masterConfig.onXhr) {
|
|
||||||
masterConfig.onXhr(xhr, url);
|
|
||||||
}
|
|
||||||
|
|
||||||
xhr.onreadystatechange = function (evt) {
|
|
||||||
var status, err;
|
|
||||||
//Do not explicitly handle errors, those should be
|
|
||||||
//visible via console output in the browser.
|
|
||||||
if (xhr.readyState === 4) {
|
|
||||||
status = xhr.status || 0;
|
|
||||||
if (status > 399 && status < 600) {
|
|
||||||
//An http 4xx or 5xx error. Signal an error.
|
|
||||||
err = new Error(url + ' HTTP status: ' + status);
|
|
||||||
err.xhr = xhr;
|
|
||||||
if (errback) {
|
|
||||||
errback(err);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
callback(xhr.responseText);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (masterConfig.onXhrComplete) {
|
|
||||||
masterConfig.onXhrComplete(xhr, url);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
xhr.send(null);
|
|
||||||
};
|
|
||||||
} else if (masterConfig.env === 'rhino' || (!masterConfig.env &&
|
|
||||||
typeof Packages !== 'undefined' && typeof java !== 'undefined')) {
|
|
||||||
//Why Java, why is this so awkward?
|
|
||||||
text.get = function (url, callback) {
|
|
||||||
var stringBuffer, line,
|
|
||||||
encoding = "utf-8",
|
|
||||||
file = new java.io.File(url),
|
|
||||||
lineSeparator = java.lang.System.getProperty("line.separator"),
|
|
||||||
input = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(file), encoding)),
|
|
||||||
content = '';
|
|
||||||
try {
|
|
||||||
stringBuffer = new java.lang.StringBuffer();
|
|
||||||
line = input.readLine();
|
|
||||||
|
|
||||||
// Byte Order Mark (BOM) - The Unicode Standard, version 3.0, page 324
|
|
||||||
// http://www.unicode.org/faq/utf_bom.html
|
|
||||||
|
|
||||||
// Note that when we use utf-8, the BOM should appear as "EF BB BF", but it doesn't due to this bug in the JDK:
|
|
||||||
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4508058
|
|
||||||
if (line && line.length() && line.charAt(0) === 0xfeff) {
|
|
||||||
// Eat the BOM, since we've already found the encoding on this file,
|
|
||||||
// and we plan to concatenating this buffer with others; the BOM should
|
|
||||||
// only appear at the top of a file.
|
|
||||||
line = line.substring(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (line !== null) {
|
|
||||||
stringBuffer.append(line);
|
|
||||||
}
|
|
||||||
|
|
||||||
while ((line = input.readLine()) !== null) {
|
|
||||||
stringBuffer.append(lineSeparator);
|
|
||||||
stringBuffer.append(line);
|
|
||||||
}
|
|
||||||
//Make sure we return a JavaScript string and not a Java string.
|
|
||||||
content = String(stringBuffer.toString()); //String
|
|
||||||
} finally {
|
|
||||||
input.close();
|
|
||||||
}
|
|
||||||
callback(content);
|
|
||||||
};
|
|
||||||
} else if (masterConfig.env === 'xpconnect' || (!masterConfig.env &&
|
|
||||||
typeof Components !== 'undefined' && Components.classes &&
|
|
||||||
Components.interfaces)) {
|
|
||||||
//Avert your gaze!
|
|
||||||
Cc = Components.classes;
|
|
||||||
Ci = Components.interfaces;
|
|
||||||
Components.utils['import']('resource://gre/modules/FileUtils.jsm');
|
|
||||||
xpcIsWindows = ('@mozilla.org/windows-registry-key;1' in Cc);
|
|
||||||
|
|
||||||
text.get = function (url, callback) {
|
|
||||||
var inStream, convertStream, fileObj,
|
|
||||||
readData = {};
|
|
||||||
|
|
||||||
if (xpcIsWindows) {
|
|
||||||
url = url.replace(/\//g, '\\');
|
|
||||||
}
|
|
||||||
|
|
||||||
fileObj = new FileUtils.File(url);
|
|
||||||
|
|
||||||
//XPCOM, you so crazy
|
|
||||||
try {
|
|
||||||
inStream = Cc['@mozilla.org/network/file-input-stream;1']
|
|
||||||
.createInstance(Ci.nsIFileInputStream);
|
|
||||||
inStream.init(fileObj, 1, 0, false);
|
|
||||||
|
|
||||||
convertStream = Cc['@mozilla.org/intl/converter-input-stream;1']
|
|
||||||
.createInstance(Ci.nsIConverterInputStream);
|
|
||||||
convertStream.init(inStream, "utf-8", inStream.available(),
|
|
||||||
Ci.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER);
|
|
||||||
|
|
||||||
convertStream.readString(inStream.available(), readData);
|
|
||||||
convertStream.close();
|
|
||||||
inStream.close();
|
|
||||||
callback(readData.value);
|
|
||||||
} catch (e) {
|
|
||||||
throw new Error((fileObj && fileObj.path || '') + ': ' + e);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
return text;
|
|
||||||
});
|
|
||||||
@@ -1,124 +0,0 @@
|
|||||||
{
|
|
||||||
"docs": [
|
|
||||||
{
|
|
||||||
"location": "/",
|
|
||||||
"text": "yaml\n\n\nyaml 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\ndownload latest binary\n\n\nget the source\n\n\ngo get github.com/mikefarah/yaml\n\n\n\n\n.zip\n or \ntar.gz\n\n\nView on GitHub",
|
|
||||||
"title": "Install"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"location": "/#yaml",
|
|
||||||
"text": "yaml is a lightweight and portable command-line YAML processor The aim of the project is to be the jq or sed of yaml files.",
|
|
||||||
"title": "yaml"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"location": "/#download-latest-binary",
|
|
||||||
"text": "",
|
|
||||||
"title": "download latest binary"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"location": "/#get-the-source",
|
|
||||||
"text": "go get github.com/mikefarah/yaml .zip or tar.gz View on GitHub",
|
|
||||||
"title": "get the source"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"location": "/read/",
|
|
||||||
"text": "yaml r \nyaml_file|json_file\n \npath\n\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\n\nGiven a sample.yaml file of:\n\n\nb:\n c: 2\n\n\n\n\nthen\n\n\nyaml r sample.yaml b.c\n\n\n\n\nwill output the value of '2'.\n\n\nFrom Stdin\n\n\nGiven a sample.yaml file of:\n\n\ncat sample.yaml | yaml r - b.c\n\n\n\n\nwill output the value of '2'.\n\n\nSplat\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\nyaml r sample.yaml bob.*.cats\n\n\n\n\nwill output\n\n\n- bananas\n- apples\n\n\n\n\nHandling '.' in the yaml key\n\n\nGiven a sample.yaml file of:\n\n\nb.x:\n c: 2\n\n\n\n\nthen\n\n\nyaml r sample.yaml \\\nb.x\\\n.c\n\n\n\n\nwill output the value of '2'.\n\n\nArrays\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\nyaml r sample.yaml b.e[1].name\n\n\n\n\nwill output 'sam'\n\n\nArray Splat\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\nyaml r sample.yaml b.e[*].name\n\n\n\n\nwill output:\n\n\n- fred\n- sam",
|
|
||||||
"title": "Read"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"location": "/read/#basic",
|
|
||||||
"text": "Given a sample.yaml file of: b:\n c: 2 then yaml r sample.yaml b.c will output the value of '2'.",
|
|
||||||
"title": "Basic"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"location": "/read/#from-stdin",
|
|
||||||
"text": "Given a sample.yaml file of: cat sample.yaml | yaml r - b.c will output the value of '2'.",
|
|
||||||
"title": "From Stdin"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"location": "/read/#splat",
|
|
||||||
"text": "Given a sample.yaml file of: ---\nbob:\n item1:\n cats: bananas\n item2:\n cats: apples then yaml r sample.yaml bob.*.cats will output - bananas\n- apples",
|
|
||||||
"title": "Splat"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"location": "/read/#handling-in-the-yaml-key",
|
|
||||||
"text": "Given a sample.yaml file of: b.x:\n c: 2 then yaml r sample.yaml \\ b.x\\ .c will output the value of '2'.",
|
|
||||||
"title": "Handling '.' in the yaml key"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"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 yaml r sample.yaml b.e[1].name will output 'sam'",
|
|
||||||
"title": "Arrays"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"location": "/read/#array-splat",
|
|
||||||
"text": "e.g.: given a sample file of b:\n e:\n - name: fred\n value: 3\n - name: sam\n value: 4 then yaml r sample.yaml b.e[*].name will output: - fred\n- sam",
|
|
||||||
"title": "Array Splat"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"location": "/write/",
|
|
||||||
"text": "yaml w \nyaml_file|json_file\n \npath\n \nnew value\n\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\n\nGiven a sample.yaml file of:\n\n\nb:\n c: 2\n\n\n\n\nthen\n\n\nyaml 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\n\ncat sample.yaml | yaml w - b.c blah\n\n\n\n\nAdding new fields\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\nyaml w sample.yaml b.d[0] \nnew thing\n\n\n\n\n\nwill output:\n\n\nb:\n c: cat\n d:\n - new thing\n\n\n\n\nUpdating files in-place\n\n\nGiven a sample.yaml file of:\n\n\nb:\n c: 2\n\n\n\n\nthen\n\n\nyaml 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\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\nyaml 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 | yaml w -s - sample.yaml\n\n\n\n\nValues starting with a hyphen (or dash)\n\n\nThe flag terminator needs to be used to stop the app from attempting to parse the subsequent arguments as flags:\n\n\nyaml w -- my.path -3\n\n\n\n\nwill output\n\n\nmy:\n path: -3",
|
|
||||||
"title": "Write/Update"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"location": "/write/#to-stdout",
|
|
||||||
"text": "Given a sample.yaml file of: b:\n c: 2 then yaml w sample.yaml b.c cat will output: b:\n c: cat",
|
|
||||||
"title": "To Stdout"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"location": "/write/#from-stdin",
|
|
||||||
"text": "cat sample.yaml | yaml w - b.c blah",
|
|
||||||
"title": "From STDIN"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"location": "/write/#adding-new-fields",
|
|
||||||
"text": "Any missing fields in the path will be created on the fly. Given a sample.yaml file of: b:\n c: 2 then yaml w sample.yaml b.d[0] new thing will output: b:\n c: cat\n d:\n - new thing",
|
|
||||||
"title": "Adding new fields"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"location": "/write/#updating-files-in-place",
|
|
||||||
"text": "Given a sample.yaml file of: b:\n c: 2 then yaml w -i sample.yaml b.c cat will update the sample.yaml file so that the value of 'c' is cat.",
|
|
||||||
"title": "Updating files in-place"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"location": "/write/#updating-multiple-values-with-a-script",
|
|
||||||
"text": "Given a sample.yaml file of: b:\n c: 2\n e:\n - name: Billy Bob and a script update_instructions.yaml of: b.c: 3\nb.e[0].name: Howdy Partner then yaml w -s update_instructions.yaml sample.yaml will output: b:\n c: 3\n e:\n - name: Howdy Partner And, of course, you can pipe the instructions in using '-': cat update_instructions.yaml | yaml w -s - sample.yaml",
|
|
||||||
"title": "Updating multiple values with a script"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"location": "/write/#values-starting-with-a-hyphen-or-dash",
|
|
||||||
"text": "The flag terminator needs to be used to stop the app from attempting to parse the subsequent arguments as flags: yaml w -- my.path -3 will output my:\n path: -3",
|
|
||||||
"title": "Values starting with a hyphen (or dash)"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"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\nyaml n \npath\n \nnew value\n\n\n\n\n\nCreating a simple yaml file\n\n\nyaml 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\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\nyaml 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 | yaml n -s -",
|
|
||||||
"title": "Create"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"location": "/create/#creating-a-simple-yaml-file",
|
|
||||||
"text": "yaml n b.c cat will output: b:\n c: cat",
|
|
||||||
"title": "Creating a simple yaml file"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"location": "/create/#creating-using-a-create-script",
|
|
||||||
"text": "Create scripts follow the same format as the update scripts. Given a script create_instructions.yaml of: b.c: 3\nb.e[0].name: Howdy Partner then yaml n -s create_instructions.yaml will output: b:\n c: 3\n e:\n - name: Howdy Partner You can also pipe the instructions in: cat create_instructions.yaml | yaml n -s -",
|
|
||||||
"title": "Creating using a create script"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"location": "/convert/",
|
|
||||||
"text": "Yaml to Json\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\nyaml r -j sample.yaml b.c\n\n\n\n\nwill output\n\n\n{\nb\n:{\nc\n:2}}\n\n\n\n\nJson to Yaml\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{\na\n:\nEasy! as one two three\n,\nb\n:{\nc\n:2,\nd\n:[3,4]}}\n\n\n\n\nthen\n\n\nyaml 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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"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 yaml r -j sample.yaml b.c will output { b :{ c :2}}",
|
|
||||||
"title": "Yaml to Json"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"location": "/convert/#json-to-yaml",
|
|
||||||
"text": "To read in json, just pass in a json file instead of yaml, it will just work :) e.g given a json file { a : Easy! as one two three , b :{ c :2, d :[3,4]}} then yaml r sample.json will output a: Easy! as one two three\nb:\n c: 2\n d:\n - 3\n - 4",
|
|
||||||
"title": "Json to Yaml"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
631
docs/prefix/index.html
Normal file
@@ -0,0 +1,631 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en" class="no-js">
|
||||||
|
<head>
|
||||||
|
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
|
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<meta name="lang:clipboard.copy" content="Copy to clipboard">
|
||||||
|
|
||||||
|
<meta name="lang:clipboard.copied" content="Copied to clipboard">
|
||||||
|
|
||||||
|
<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.one" content="1 matching document">
|
||||||
|
|
||||||
|
<meta name="lang:search.result.other" content="# matching documents">
|
||||||
|
|
||||||
|
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||||
|
|
||||||
|
<link rel="shortcut icon" href="../assets/images/favicon.png">
|
||||||
|
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.2.0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<title>Prefix - Yq</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="../assets/stylesheets/application.750b69bd.css">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<script src="../assets/javascripts/modernizr.74668098.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">
|
||||||
|
<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="../assets/fonts/material-icons.css">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body dir="ltr">
|
||||||
|
|
||||||
|
<svg class="md-svg">
|
||||||
|
<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 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>
|
||||||
|
</svg>
|
||||||
|
<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" autocomplete="off">
|
||||||
|
<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">
|
||||||
|
<nav class="md-header-nav md-grid">
|
||||||
|
<div class="md-flex">
|
||||||
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
<a href=".." title="Yq" class="md-header-nav__button md-logo">
|
||||||
|
|
||||||
|
<i class="md-icon"></i>
|
||||||
|
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
<label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
|
||||||
|
</div>
|
||||||
|
<div class="md-flex__cell md-flex__cell--stretch">
|
||||||
|
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
||||||
|
|
||||||
|
<span class="md-header-nav__topic">
|
||||||
|
Yq
|
||||||
|
</span>
|
||||||
|
<span class="md-header-nav__topic">
|
||||||
|
Prefix
|
||||||
|
</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
|
||||||
|
<label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
|
||||||
|
|
||||||
|
<div class="md-search" data-md-component="search" role="dialog">
|
||||||
|
<label class="md-search__overlay" for="__search"></label>
|
||||||
|
<div class="md-search__inner" role="search">
|
||||||
|
<form class="md-search__form" name="search">
|
||||||
|
<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>
|
||||||
|
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||||
|

|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
<div class="md-search__output">
|
||||||
|
<div class="md-search__scrollwrap" data-md-scrollfix>
|
||||||
|
<div class="md-search-result" data-md-component="result">
|
||||||
|
<div class="md-search-result__meta">
|
||||||
|
Type to start searching
|
||||||
|
</div>
|
||||||
|
<ol class="md-search-result__list"></ol>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
<div class="md-header-nav__source">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://github.com/mikefarah/yq/" title="Go to repository" class="md-source" data-md-source="github">
|
||||||
|
|
||||||
|
<div class="md-source__icon">
|
||||||
|
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||||
|
<use xlink:href="#__github" width="24" height="24"></use>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="md-source__repository">
|
||||||
|
mikefarah/yq
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<div class="md-container">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<main class="md-main">
|
||||||
|
<div class="md-main__inner md-grid" data-md-component="container">
|
||||||
|
|
||||||
|
|
||||||
|
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
|
||||||
|
<div class="md-sidebar__scrollwrap">
|
||||||
|
<div class="md-sidebar__inner">
|
||||||
|
<nav class="md-nav md-nav--primary" data-md-level="0">
|
||||||
|
<label class="md-nav__title md-nav__title--site" for="__drawer">
|
||||||
|
<a href=".." title="Yq" class="md-nav__button md-logo">
|
||||||
|
|
||||||
|
<i class="md-icon"></i>
|
||||||
|
|
||||||
|
</a>
|
||||||
|
Yq
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<div class="md-nav__source">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://github.com/mikefarah/yq/" title="Go to repository" class="md-source" data-md-source="github">
|
||||||
|
|
||||||
|
<div class="md-source__icon">
|
||||||
|
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||||
|
<use xlink:href="#__github" width="24" height="24"></use>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="md-source__repository">
|
||||||
|
mikefarah/yq
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href=".." title="Install" class="md-nav__link">
|
||||||
|
Install
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../read/" title="Read" class="md-nav__link">
|
||||||
|
Read
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../write/" title="Write/Update" class="md-nav__link">
|
||||||
|
Write/Update
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item md-nav__item--active">
|
||||||
|
|
||||||
|
<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">
|
||||||
|
Prefix
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<a href="./" title="Prefix" class="md-nav__link md-nav__link--active">
|
||||||
|
Prefix
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
<nav class="md-nav md-nav--secondary">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#to-stdout" title="To Stdout" class="md-nav__link">
|
||||||
|
To Stdout
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#arbitrary-depth" title="Arbitrary depth" class="md-nav__link">
|
||||||
|
Arbitrary depth
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#updating-files-in-place" title="Updating files in-place" class="md-nav__link">
|
||||||
|
Updating files in-place
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#multiple-documents-prefix-a-single-document" title="Multiple Documents - prefix a single document" class="md-nav__link">
|
||||||
|
Multiple Documents - prefix a single document
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#multiple-documents-prefix-all-documents" title="Multiple Documents - prefix all documents" class="md-nav__link">
|
||||||
|
Multiple Documents - prefix all documents
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../delete/" title="Delete" class="md-nav__link">
|
||||||
|
Delete
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../create/" title="Create" class="md-nav__link">
|
||||||
|
Create
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../convert/" title="Convert" class="md-nav__link">
|
||||||
|
Convert
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../merge/" title="Merge" class="md-nav__link">
|
||||||
|
Merge
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
|
||||||
|
<div class="md-sidebar__scrollwrap">
|
||||||
|
<div class="md-sidebar__inner">
|
||||||
|
|
||||||
|
<nav class="md-nav md-nav--secondary">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#to-stdout" title="To Stdout" class="md-nav__link">
|
||||||
|
To Stdout
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#arbitrary-depth" title="Arbitrary depth" class="md-nav__link">
|
||||||
|
Arbitrary depth
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#updating-files-in-place" title="Updating files in-place" class="md-nav__link">
|
||||||
|
Updating files in-place
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#multiple-documents-prefix-a-single-document" title="Multiple Documents - prefix a single document" class="md-nav__link">
|
||||||
|
Multiple Documents - prefix a single document
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#multiple-documents-prefix-all-documents" title="Multiple Documents - prefix all documents" class="md-nav__link">
|
||||||
|
Multiple Documents - prefix all documents
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="md-content">
|
||||||
|
<article class="md-content__inner md-typeset">
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://github.com/mikefarah/yq/edit/master/docs/prefix.md" title="Edit this page" class="md-icon md-content__icon"></a>
|
||||||
|
|
||||||
|
|
||||||
|
<h1>Prefix</h1>
|
||||||
|
|
||||||
|
<p>Paths can be prefixed using the 'prefix' command.
|
||||||
|
The complete yaml content will be nested inside the new prefix path.</p>
|
||||||
|
<pre><code>yq p <yaml_file> <path>
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
<pre><code class="yaml">a: simple
|
||||||
|
b: [1, 2]
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>then</p>
|
||||||
|
<pre><code class="bash">yq p data1.yaml c
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>will output:</p>
|
||||||
|
<pre><code class="yaml">c:
|
||||||
|
a: simple
|
||||||
|
b: [1, 2]
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<h3 id="arbitrary-depth">Arbitrary depth<a class="headerlink" href="#arbitrary-depth" title="Permanent link">¶</a></h3>
|
||||||
|
<p>Given a data1.yaml file of:</p>
|
||||||
|
<pre><code class="yaml">a:
|
||||||
|
b: [1, 2]
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>then</p>
|
||||||
|
<pre><code class="bash">yq p data1.yaml c.d
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>will output:</p>
|
||||||
|
<pre><code class="yaml">c:
|
||||||
|
d:
|
||||||
|
a:
|
||||||
|
b: [1, 2]
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<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 data1.yaml file of:</p>
|
||||||
|
<pre><code class="yaml">a: simple
|
||||||
|
b: [1, 2]
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>then</p>
|
||||||
|
<pre><code class="bash">yq p -i data1.yaml c
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>will update the data1.yaml file so that the path 'c' is prefixed to all other paths.</p>
|
||||||
|
<h3 id="multiple-documents-prefix-a-single-document">Multiple Documents - prefix a single document<a class="headerlink" href="#multiple-documents-prefix-a-single-document" title="Permanent link">¶</a></h3>
|
||||||
|
<p>Given a data1.yaml file of:</p>
|
||||||
|
<pre><code class="yaml">something: else
|
||||||
|
---
|
||||||
|
a: simple
|
||||||
|
b: cat
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>then</p>
|
||||||
|
<pre><code class="bash">yq p -d1 data1.yaml c
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>will output:</p>
|
||||||
|
<pre><code class="yaml">something: else
|
||||||
|
---
|
||||||
|
c:
|
||||||
|
a: simple
|
||||||
|
b: cat
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<h3 id="multiple-documents-prefix-all-documents">Multiple Documents - prefix all documents<a class="headerlink" href="#multiple-documents-prefix-all-documents" title="Permanent link">¶</a></h3>
|
||||||
|
<p>Given a data1.yaml file of:</p>
|
||||||
|
<pre><code class="yaml">something: else
|
||||||
|
---
|
||||||
|
a: simple
|
||||||
|
b: cat
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>then</p>
|
||||||
|
<pre><code class="bash">yq p -d'*' data1.yaml c
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>will output:</p>
|
||||||
|
<pre><code class="yaml">c:
|
||||||
|
something: else
|
||||||
|
---
|
||||||
|
c:
|
||||||
|
a: simple
|
||||||
|
b: cat
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</article>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
|
||||||
|
<footer class="md-footer">
|
||||||
|
|
||||||
|
<div class="md-footer-nav">
|
||||||
|
<nav class="md-footer-nav__inner md-grid">
|
||||||
|
|
||||||
|
<a href="../write/" title="Write/Update" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
|
||||||
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
<i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
|
||||||
|
</div>
|
||||||
|
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
|
||||||
|
<span class="md-flex__ellipsis">
|
||||||
|
<span class="md-footer-nav__direction">
|
||||||
|
Previous
|
||||||
|
</span>
|
||||||
|
Write/Update
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
<a href="../delete/" title="Delete" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
|
||||||
|
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
|
||||||
|
<span class="md-flex__ellipsis">
|
||||||
|
<span class="md-footer-nav__direction">
|
||||||
|
Next
|
||||||
|
</span>
|
||||||
|
Delete
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
<i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="md-footer-meta md-typeset">
|
||||||
|
<div class="md-footer-meta__inner md-grid">
|
||||||
|
<div class="md-footer-copyright">
|
||||||
|
|
||||||
|
powered by
|
||||||
|
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||||
|
and
|
||||||
|
<a href="https://squidfunk.github.io/mkdocs-material/">
|
||||||
|
Material for MkDocs</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="md-footer-social">
|
||||||
|
<link rel="stylesheet" href="../assets/fonts/font-awesome.css">
|
||||||
|
|
||||||
|
<a href="https://github.com/mikefarah" class="md-footer-social__link fa fa-github"></a>
|
||||||
|
|
||||||
|
<a href="https://www.linkedin.com/in/mike-farah-b5a75b2/" class="md-footer-social__link fa fa-linkedin"></a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="../assets/javascripts/application.39abc4af.js"></script>
|
||||||
|
|
||||||
|
<script>app.initialize({version:"1.0.4",url:{base:".."}})</script>
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -1,99 +1,147 @@
|
|||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html class="no-js">
|
|
||||||
|
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en" class="no-js">
|
||||||
<head>
|
<head>
|
||||||
|
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
|
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="shortcut icon" href="../assets/images/favicon.png">
|
<meta name="lang:clipboard.copy" content="Copy to clipboard">
|
||||||
|
|
||||||
<meta name="generator" content="mkdocs-0.16.3, mkdocs-material-1.5.4">
|
<meta name="lang:clipboard.copied" content="Copied to clipboard">
|
||||||
|
|
||||||
|
<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.one" content="1 matching document">
|
||||||
|
|
||||||
|
<meta name="lang:search.result.other" content="# matching documents">
|
||||||
|
|
||||||
|
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||||
|
|
||||||
|
<link rel="shortcut icon" href="../assets/images/favicon.png">
|
||||||
|
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.2.0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<title>Read - Yaml</title>
|
<title>Read - Yq</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script src="../assets/javascripts/modernizr-56ade86843.js"></script>
|
<link rel="stylesheet" href="../assets/stylesheets/application.750b69bd.css">
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../assets/stylesheets/application-b1a1975878.css">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<script src="../assets/javascripts/modernizr.74668098.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 dir="ltr">
|
||||||
|
|
||||||
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<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">
|
||||||
<div class="md-flex">
|
<div class="md-flex">
|
||||||
<div class="md-flex__cell md-flex__cell--shrink">
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
<a href=".." title="Yq" class="md-header-nav__button md-logo">
|
||||||
<a href=".." title="Yaml" class="md-icon md-icon--home md-header-nav__button">
|
|
||||||
</a>
|
<i class="md-icon"></i>
|
||||||
|
|
||||||
|
</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">
|
||||||
<span class="md-flex__ellipsis md-header-nav__title">
|
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
||||||
|
|
||||||
|
<span class="md-header-nav__topic">
|
||||||
|
Yq
|
||||||
|
</span>
|
||||||
Read
|
<span class="md-header-nav__topic">
|
||||||
|
Read
|
||||||
|
</span>
|
||||||
|
|
||||||
</span>
|
</div>
|
||||||
</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--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">
|
<div class="md-search" data-md-component="search" role="dialog">
|
||||||
<div class="md-search__overlay"></div>
|
<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" accesskey="s" 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">close</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>
|
||||||
<div class="md-search-result" data-md-component="result">
|
<div class="md-search-result" data-md-component="result">
|
||||||
<div class="md-search-result__meta" data-md-lang-result-none="No matching documents" data-md-lang-result-one="1 matching document" data-md-lang-result-other="# matching documents">
|
<div class="md-search-result__meta">
|
||||||
Type to start searching
|
Type to start searching
|
||||||
</div>
|
</div>
|
||||||
<ol class="md-search-result__list"></ol>
|
<ol class="md-search-result__list"></ol>
|
||||||
@@ -104,37 +152,37 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="md-flex__cell md-flex__cell--shrink">
|
|
||||||
<div class="md-header-nav__source">
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
<div class="md-header-nav__source">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://github.com/mikefarah/yq/" title="Go to repository" class="md-source" data-md-source="github">
|
||||||
<a href="https://github.com/mikefarah/yaml" title="Go to repository" class="md-source" data-md-source="github">
|
|
||||||
|
<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 class="md-source__repository">
|
|
||||||
mikefarah/yaml
|
|
||||||
</div>
|
</div>
|
||||||
</a>
|
|
||||||
|
<div class="md-source__repository">
|
||||||
|
mikefarah/yq
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div class="md-container">
|
<div class="md-container">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<main class="md-main">
|
<main class="md-main">
|
||||||
<div class="md-main__inner md-grid" data-md-component="container">
|
<div class="md-main__inner md-grid" data-md-component="container">
|
||||||
@@ -144,11 +192,13 @@
|
|||||||
<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">
|
||||||
|
<a href=".." title="Yq" class="md-nav__button md-logo">
|
||||||
<i class="md-icon md-icon--home md-nav__button"></i>
|
|
||||||
|
<i class="md-icon"></i>
|
||||||
Yaml
|
|
||||||
|
</a>
|
||||||
|
Yq
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<div class="md-nav__source">
|
<div class="md-nav__source">
|
||||||
@@ -157,20 +207,18 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://github.com/mikefarah/yq/" title="Go to repository" class="md-source" data-md-source="github">
|
||||||
<a href="https://github.com/mikefarah/yaml" title="Go to repository" class="md-source" data-md-source="github">
|
|
||||||
|
<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 class="md-source__repository">
|
|
||||||
mikefarah/yaml
|
|
||||||
</div>
|
</div>
|
||||||
</a>
|
|
||||||
|
<div class="md-source__repository">
|
||||||
|
mikefarah/yq
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ul class="md-nav__list" data-md-scrollfix>
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
@@ -196,10 +244,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>
|
||||||
|
|
||||||
@@ -212,7 +260,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">
|
||||||
@@ -237,8 +285,22 @@
|
|||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="md-nav__item">
|
<li class="md-nav__item">
|
||||||
<a href="#handling-in-the-yaml-key" title="Handling '.' in the yaml key" class="md-nav__link">
|
<a href="#prefix-splat" title="Prefix Splat" class="md-nav__link">
|
||||||
Handling '.' in the yaml key
|
Prefix Splat
|
||||||
|
</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>
|
</a>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
@@ -257,6 +319,22 @@
|
|||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#keys-with-dots" title="Keys with dots" class="md-nav__link">
|
||||||
|
Keys with dots
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#keys-and-values-with-leading-dashes" title="Keys (and values) with leading dashes" class="md-nav__link">
|
||||||
|
Keys (and values) with leading dashes
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
@@ -283,6 +361,30 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../prefix/" title="Prefix" class="md-nav__link">
|
||||||
|
Prefix
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../delete/" title="Delete" class="md-nav__link">
|
||||||
|
Delete
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<li class="md-nav__item">
|
<li class="md-nav__item">
|
||||||
<a href="../create/" title="Create" class="md-nav__link">
|
<a href="../create/" title="Create" class="md-nav__link">
|
||||||
Create
|
Create
|
||||||
@@ -302,6 +404,18 @@
|
|||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../merge/" title="Merge" class="md-nav__link">
|
||||||
|
Merge
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
@@ -317,7 +431,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">
|
||||||
@@ -342,8 +456,22 @@
|
|||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="md-nav__item">
|
<li class="md-nav__item">
|
||||||
<a href="#handling-in-the-yaml-key" title="Handling '.' in the yaml key" class="md-nav__link">
|
<a href="#prefix-splat" title="Prefix Splat" class="md-nav__link">
|
||||||
Handling '.' in the yaml key
|
Prefix Splat
|
||||||
|
</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>
|
</a>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
@@ -362,6 +490,22 @@
|
|||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#keys-with-dots" title="Keys with dots" class="md-nav__link">
|
||||||
|
Keys with dots
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#keys-and-values-with-leading-dashes" title="Keys (and values) with leading dashes" class="md-nav__link">
|
||||||
|
Keys (and values) with leading dashes
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
@@ -376,10 +520,12 @@
|
|||||||
<article class="md-content__inner md-typeset">
|
<article class="md-content__inner md-typeset">
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://github.com/mikefarah/yq/edit/master/docs/read.md" title="Edit this page" class="md-icon md-content__icon"></a>
|
||||||
|
|
||||||
|
|
||||||
<h1>Read</h1>
|
<h1>Read</h1>
|
||||||
|
|
||||||
<pre><code>yaml r <yaml_file|json_file> <path>
|
<pre><code>yq r <yaml_file|json_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>
|
<p>This command can take a json file as input too, and will output yaml unless specified to export as json (-j)</p>
|
||||||
@@ -390,13 +536,13 @@
|
|||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>then</p>
|
<p>then</p>
|
||||||
<pre><code class="bash">yaml r sample.yaml b.c
|
<pre><code class="bash">yq r sample.yaml b.c
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>will output the value of '2'.</p>
|
<p>will output the value of '2'.</p>
|
||||||
<h3 id="from-stdin">From Stdin<a class="headerlink" href="#from-stdin" title="Permanent link">¶</a></h3>
|
<h3 id="from-stdin">From Stdin<a class="headerlink" href="#from-stdin" title="Permanent link">¶</a></h3>
|
||||||
<p>Given a sample.yaml file of:</p>
|
<p>Given a sample.yaml file of:</p>
|
||||||
<pre><code class="bash">cat sample.yaml | yaml r - b.c
|
<pre><code class="bash">cat sample.yaml | yq r - b.c
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>will output the value of '2'.</p>
|
<p>will output the value of '2'.</p>
|
||||||
@@ -408,10 +554,34 @@ bob:
|
|||||||
cats: bananas
|
cats: bananas
|
||||||
item2:
|
item2:
|
||||||
cats: apples
|
cats: apples
|
||||||
|
thing:
|
||||||
|
cats: oranges
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>then</p>
|
<p>then</p>
|
||||||
<pre><code class="bash">yaml r sample.yaml bob.*.cats
|
<pre><code class="bash">yq r sample.yaml bob.*.cats
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>will output</p>
|
||||||
|
<pre><code class="yaml">- bananas
|
||||||
|
- apples
|
||||||
|
- oranges
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<h3 id="prefix-splat">Prefix Splat<a class="headerlink" href="#prefix-splat" title="Permanent link">¶</a></h3>
|
||||||
|
<p>Given a sample.yaml file of:</p>
|
||||||
|
<pre><code class="yaml">---
|
||||||
|
bob:
|
||||||
|
item1:
|
||||||
|
cats: bananas
|
||||||
|
item2:
|
||||||
|
cats: apples
|
||||||
|
thing:
|
||||||
|
cats: oranges
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>then</p>
|
||||||
|
<pre><code class="bash">yq r sample.yaml bob.item*.cats
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>will output</p>
|
<p>will output</p>
|
||||||
@@ -419,17 +589,42 @@ bob:
|
|||||||
- apples
|
- apples
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<h3 id="handling-in-the-yaml-key">Handling '.' in the yaml key<a class="headerlink" href="#handling-in-the-yaml-key" title="Permanent link">¶</a></h3>
|
<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>
|
<p>Given a sample.yaml file of:</p>
|
||||||
<pre><code class="yaml">b.x:
|
<pre><code class="yaml">something: else
|
||||||
|
---
|
||||||
|
b:
|
||||||
c: 2
|
c: 2
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>then</p>
|
<p>then</p>
|
||||||
<pre><code class="bash">yaml r sample.yaml \"b.x\".c
|
<pre><code class="bash">yq r -d1 sample.yaml b.c
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>will output the value of '2'.</p>
|
<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>
|
||||||
@@ -442,10 +637,11 @@ e.g.: given a sample file of</p>
|
|||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>then</p>
|
<p>then</p>
|
||||||
<pre><code>yaml r sample.yaml b.e[1].name
|
<pre><code>yq r sample.yaml 'b.e[1].name'
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>will output 'sam'</p>
|
<p>will output 'sam'</p>
|
||||||
|
<p>Note that the path is in quotes to avoid the square brackets being interpreted by your shell.</p>
|
||||||
<h3 id="array-splat">Array Splat<a class="headerlink" href="#array-splat" title="Permanent link">¶</a></h3>
|
<h3 id="array-splat">Array Splat<a class="headerlink" href="#array-splat" title="Permanent link">¶</a></h3>
|
||||||
<p>e.g.: given a sample file of</p>
|
<p>e.g.: given a sample file of</p>
|
||||||
<pre><code class="yaml">b:
|
<pre><code class="yaml">b:
|
||||||
@@ -457,19 +653,46 @@ e.g.: given a sample file of</p>
|
|||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>then</p>
|
<p>then</p>
|
||||||
<pre><code>yaml r sample.yaml b.e[*].name
|
<pre><code>yq r sample.yaml 'b.e[*].name'
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>will output:</p>
|
<p>will output:</p>
|
||||||
<pre><code>- fred
|
<pre><code>- fred
|
||||||
- sam
|
- sam
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
|
<p>Note that the path is in quotes to avoid the square brackets 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>
|
||||||
|
<p>When specifying a key that has a dot use key lookup indicator.</p>
|
||||||
|
<pre><code class="yaml">b:
|
||||||
|
foo.bar: 7
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<pre><code class="bash">yaml r sample.yaml 'b[foo.bar]'
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<pre><code class="bash">yaml w sample.yaml 'b[foo.bar]' 9
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>Any valid yaml key can be specified as part of a key lookup.</p>
|
||||||
|
<p>Note that the path is in quotes to avoid the square brackets being interpreted by your shell.</p>
|
||||||
|
<h3 id="keys-and-values-with-leading-dashes">Keys (and values) with leading dashes<a class="headerlink" href="#keys-and-values-with-leading-dashes" title="Permanent link">¶</a></h3>
|
||||||
|
<p>If a key or value has leading dashes, yq won't know that you are passing a value as opposed to a flag (and you will get a 'bad flag syntax' error).</p>
|
||||||
|
<p>To fix that, you will need to tell it to stop processing flags by adding '--' after the last flag like so:</p>
|
||||||
|
<pre><code class="bash">yq n -t -- --key --value
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>Will result in</p>
|
||||||
|
<p><code>`
|
||||||
|
--key: --value</code></p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
@@ -519,16 +742,14 @@ 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" title="MkDocs">MkDocs</a>
|
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||||
and
|
and
|
||||||
<a href="http://squidfunk.github.io/mkdocs-material/" title="Material for MkDocs">
|
<a href="https://squidfunk.github.io/mkdocs-material/">
|
||||||
Material for MkDocs</a>
|
Material for MkDocs</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<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>
|
||||||
|
|
||||||
@@ -536,18 +757,15 @@ e.g.: given a sample file of</p>
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="../assets/javascripts/application-0b7df094bf.js"></script>
|
<script src="../assets/javascripts/application.39abc4af.js"></script>
|
||||||
<script>app.initialize({url:{base:".."}})</script>
|
|
||||||
|
|
||||||
|
<script>app.initialize({version:"1.0.4",url:{base:".."}})</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
1
docs/search/search_index.json
Normal file
@@ -1,44 +1,43 @@
|
|||||||
<?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>None</loc>
|
||||||
<lastmod>2017-05-03</lastmod>
|
<lastmod>2019-05-16</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<url>
|
<url>
|
||||||
<loc>/read/</loc>
|
<loc>None</loc>
|
||||||
<lastmod>2017-05-03</lastmod>
|
<lastmod>2019-05-16</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<url>
|
<url>
|
||||||
<loc>/write/</loc>
|
<loc>None</loc>
|
||||||
<lastmod>2017-05-03</lastmod>
|
<lastmod>2019-05-16</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<url>
|
<url>
|
||||||
<loc>/create/</loc>
|
<loc>None</loc>
|
||||||
<lastmod>2017-05-03</lastmod>
|
<lastmod>2019-05-16</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<url>
|
<url>
|
||||||
<loc>/convert/</loc>
|
<loc>None</loc>
|
||||||
<lastmod>2017-05-03</lastmod>
|
<lastmod>2019-05-16</lastmod>
|
||||||
|
<changefreq>daily</changefreq>
|
||||||
|
</url>
|
||||||
|
<url>
|
||||||
|
<loc>None</loc>
|
||||||
|
<lastmod>2019-05-16</lastmod>
|
||||||
|
<changefreq>daily</changefreq>
|
||||||
|
</url>
|
||||||
|
<url>
|
||||||
|
<loc>None</loc>
|
||||||
|
<lastmod>2019-05-16</lastmod>
|
||||||
|
<changefreq>daily</changefreq>
|
||||||
|
</url>
|
||||||
|
<url>
|
||||||
|
<loc>None</loc>
|
||||||
|
<lastmod>2019-05-16</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
|
|
||||||
|
|
||||||
</urlset>
|
</urlset>
|
||||||
BIN
docs/sitemap.xml.gz
Normal file
447
docs/snippets/niche/index.html
Normal file
@@ -0,0 +1,447 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en" class="no-js">
|
||||||
|
<head>
|
||||||
|
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
|
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<meta name="lang:clipboard.copy" content="Copy to clipboard">
|
||||||
|
|
||||||
|
<meta name="lang:clipboard.copied" content="Copied to clipboard">
|
||||||
|
|
||||||
|
<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.one" content="1 matching document">
|
||||||
|
|
||||||
|
<meta name="lang:search.result.other" content="# matching documents">
|
||||||
|
|
||||||
|
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||||
|
|
||||||
|
<link rel="shortcut icon" href="../../assets/images/favicon.png">
|
||||||
|
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.2.0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<title>Niche - Yq</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="../../assets/stylesheets/application.750b69bd.css">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<script src="../../assets/javascripts/modernizr.74668098.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">
|
||||||
|
<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="../../assets/fonts/material-icons.css">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body dir="ltr">
|
||||||
|
|
||||||
|
<svg class="md-svg">
|
||||||
|
<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 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>
|
||||||
|
</svg>
|
||||||
|
<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" autocomplete="off">
|
||||||
|
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
|
||||||
|
|
||||||
|
<a href="#keys-with-dots" tabindex="1" class="md-skip">
|
||||||
|
Skip to content
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
<header class="md-header" data-md-component="header">
|
||||||
|
<nav class="md-header-nav md-grid">
|
||||||
|
<div class="md-flex">
|
||||||
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
<a href="../.." title="Yq" class="md-header-nav__button md-logo">
|
||||||
|
|
||||||
|
<i class="md-icon"></i>
|
||||||
|
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
<label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
|
||||||
|
</div>
|
||||||
|
<div class="md-flex__cell md-flex__cell--stretch">
|
||||||
|
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
||||||
|
|
||||||
|
<span class="md-header-nav__topic">
|
||||||
|
Yq
|
||||||
|
</span>
|
||||||
|
<span class="md-header-nav__topic">
|
||||||
|
Niche
|
||||||
|
</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
|
||||||
|
<label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
|
||||||
|
|
||||||
|
<div class="md-search" data-md-component="search" role="dialog">
|
||||||
|
<label class="md-search__overlay" for="__search"></label>
|
||||||
|
<div class="md-search__inner" role="search">
|
||||||
|
<form class="md-search__form" name="search">
|
||||||
|
<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>
|
||||||
|
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||||
|

|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
<div class="md-search__output">
|
||||||
|
<div class="md-search__scrollwrap" data-md-scrollfix>
|
||||||
|
<div class="md-search-result" data-md-component="result">
|
||||||
|
<div class="md-search-result__meta">
|
||||||
|
Type to start searching
|
||||||
|
</div>
|
||||||
|
<ol class="md-search-result__list"></ol>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
<div class="md-header-nav__source">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://github.com/mikefarah/yq/" title="Go to repository" class="md-source" data-md-source="github">
|
||||||
|
|
||||||
|
<div class="md-source__icon">
|
||||||
|
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||||
|
<use xlink:href="#__github" width="24" height="24"></use>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="md-source__repository">
|
||||||
|
mikefarah/yq
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<div class="md-container">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<main class="md-main">
|
||||||
|
<div class="md-main__inner md-grid" data-md-component="container">
|
||||||
|
|
||||||
|
|
||||||
|
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
|
||||||
|
<div class="md-sidebar__scrollwrap">
|
||||||
|
<div class="md-sidebar__inner">
|
||||||
|
<nav class="md-nav md-nav--primary" data-md-level="0">
|
||||||
|
<label class="md-nav__title md-nav__title--site" for="__drawer">
|
||||||
|
<a href="../.." title="Yq" class="md-nav__button md-logo">
|
||||||
|
|
||||||
|
<i class="md-icon"></i>
|
||||||
|
|
||||||
|
</a>
|
||||||
|
Yq
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<div class="md-nav__source">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://github.com/mikefarah/yq/" title="Go to repository" class="md-source" data-md-source="github">
|
||||||
|
|
||||||
|
<div class="md-source__icon">
|
||||||
|
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||||
|
<use xlink:href="#__github" width="24" height="24"></use>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="md-source__repository">
|
||||||
|
mikefarah/yq
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../.." title="Install" class="md-nav__link">
|
||||||
|
Install
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../../read/" title="Read" class="md-nav__link">
|
||||||
|
Read
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../../write/" title="Write/Update" class="md-nav__link">
|
||||||
|
Write/Update
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../../prefix/" title="Prefix" class="md-nav__link">
|
||||||
|
Prefix
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../../delete/" title="Delete" class="md-nav__link">
|
||||||
|
Delete
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../../create/" title="Create" class="md-nav__link">
|
||||||
|
Create
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../../convert/" title="Convert" class="md-nav__link">
|
||||||
|
Convert
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../../merge/" title="Merge" class="md-nav__link">
|
||||||
|
Merge
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
|
||||||
|
<div class="md-sidebar__scrollwrap">
|
||||||
|
<div class="md-sidebar__inner">
|
||||||
|
|
||||||
|
<nav class="md-nav md-nav--secondary">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#keys-with-dots" title="Keys with dots" class="md-nav__link">
|
||||||
|
Keys with dots
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#keys-and-values-with-leading-dashes" title="Keys (and values) with leading dashes" class="md-nav__link">
|
||||||
|
Keys (and values) with leading dashes
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="md-content">
|
||||||
|
<article class="md-content__inner md-typeset">
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://github.com/mikefarah/yq/edit/master/docs/snippets/niche.md" title="Edit this page" class="md-icon md-content__icon"></a>
|
||||||
|
|
||||||
|
|
||||||
|
<h1>Niche</h1>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
<pre><code class="yaml">b:
|
||||||
|
foo.bar: 7
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<pre><code class="bash">yaml r sample.yaml 'b[foo.bar]'
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<pre><code class="bash">yaml w sample.yaml 'b[foo.bar]' 9
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>Any valid yaml key can be specified as part of a key lookup.</p>
|
||||||
|
<p>Note that the path is in quotes to avoid the square brackets being interpreted by your shell.</p>
|
||||||
|
<h3 id="keys-and-values-with-leading-dashes">Keys (and values) with leading dashes<a class="headerlink" href="#keys-and-values-with-leading-dashes" title="Permanent link">¶</a></h3>
|
||||||
|
<p>If a key or value has leading dashes, yq won't know that you are passing a value as opposed to a flag (and you will get a 'bad flag syntax' error).</p>
|
||||||
|
<p>To fix that, you will need to tell it to stop processing flags by adding '--' after the last flag like so:</p>
|
||||||
|
<pre><code class="bash">yq n -t -- --key --value
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>Will result in</p>
|
||||||
|
<pre><code>--key: --value
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</article>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
|
||||||
|
<footer class="md-footer">
|
||||||
|
|
||||||
|
<div class="md-footer-meta md-typeset">
|
||||||
|
<div class="md-footer-meta__inner md-grid">
|
||||||
|
<div class="md-footer-copyright">
|
||||||
|
|
||||||
|
powered by
|
||||||
|
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||||
|
and
|
||||||
|
<a href="https://squidfunk.github.io/mkdocs-material/">
|
||||||
|
Material for MkDocs</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="md-footer-social">
|
||||||
|
<link rel="stylesheet" href="../../assets/fonts/font-awesome.css">
|
||||||
|
|
||||||
|
<a href="https://github.com/mikefarah" class="md-footer-social__link fa fa-github"></a>
|
||||||
|
|
||||||
|
<a href="https://www.linkedin.com/in/mike-farah-b5a75b2/" class="md-footer-social__link fa fa-linkedin"></a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="../../assets/javascripts/application.39abc4af.js"></script>
|
||||||
|
|
||||||
|
<script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
385
docs/snippets/works_with_json/index.html
Normal file
@@ -0,0 +1,385 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en" class="no-js">
|
||||||
|
<head>
|
||||||
|
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
|
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<meta name="lang:clipboard.copy" content="Copy to clipboard">
|
||||||
|
|
||||||
|
<meta name="lang:clipboard.copied" content="Copied to clipboard">
|
||||||
|
|
||||||
|
<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.one" content="1 matching document">
|
||||||
|
|
||||||
|
<meta name="lang:search.result.other" content="# matching documents">
|
||||||
|
|
||||||
|
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||||
|
|
||||||
|
<link rel="shortcut icon" href="../../assets/images/favicon.png">
|
||||||
|
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.2.0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<title>Works with json - Yq</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="../../assets/stylesheets/application.750b69bd.css">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<script src="../../assets/javascripts/modernizr.74668098.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">
|
||||||
|
<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="../../assets/fonts/material-icons.css">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body dir="ltr">
|
||||||
|
|
||||||
|
<svg class="md-svg">
|
||||||
|
<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 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>
|
||||||
|
</svg>
|
||||||
|
<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" autocomplete="off">
|
||||||
|
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
|
||||||
|
|
||||||
|
|
||||||
|
<header class="md-header" data-md-component="header">
|
||||||
|
<nav class="md-header-nav md-grid">
|
||||||
|
<div class="md-flex">
|
||||||
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
<a href="../.." title="Yq" class="md-header-nav__button md-logo">
|
||||||
|
|
||||||
|
<i class="md-icon"></i>
|
||||||
|
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
<label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
|
||||||
|
</div>
|
||||||
|
<div class="md-flex__cell md-flex__cell--stretch">
|
||||||
|
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
||||||
|
|
||||||
|
<span class="md-header-nav__topic">
|
||||||
|
Yq
|
||||||
|
</span>
|
||||||
|
<span class="md-header-nav__topic">
|
||||||
|
Works with json
|
||||||
|
</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
|
||||||
|
<label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
|
||||||
|
|
||||||
|
<div class="md-search" data-md-component="search" role="dialog">
|
||||||
|
<label class="md-search__overlay" for="__search"></label>
|
||||||
|
<div class="md-search__inner" role="search">
|
||||||
|
<form class="md-search__form" name="search">
|
||||||
|
<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>
|
||||||
|
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||||
|

|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
<div class="md-search__output">
|
||||||
|
<div class="md-search__scrollwrap" data-md-scrollfix>
|
||||||
|
<div class="md-search-result" data-md-component="result">
|
||||||
|
<div class="md-search-result__meta">
|
||||||
|
Type to start searching
|
||||||
|
</div>
|
||||||
|
<ol class="md-search-result__list"></ol>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
<div class="md-header-nav__source">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://github.com/mikefarah/yq/" title="Go to repository" class="md-source" data-md-source="github">
|
||||||
|
|
||||||
|
<div class="md-source__icon">
|
||||||
|
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||||
|
<use xlink:href="#__github" width="24" height="24"></use>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="md-source__repository">
|
||||||
|
mikefarah/yq
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<div class="md-container">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<main class="md-main">
|
||||||
|
<div class="md-main__inner md-grid" data-md-component="container">
|
||||||
|
|
||||||
|
|
||||||
|
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
|
||||||
|
<div class="md-sidebar__scrollwrap">
|
||||||
|
<div class="md-sidebar__inner">
|
||||||
|
<nav class="md-nav md-nav--primary" data-md-level="0">
|
||||||
|
<label class="md-nav__title md-nav__title--site" for="__drawer">
|
||||||
|
<a href="../.." title="Yq" class="md-nav__button md-logo">
|
||||||
|
|
||||||
|
<i class="md-icon"></i>
|
||||||
|
|
||||||
|
</a>
|
||||||
|
Yq
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<div class="md-nav__source">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://github.com/mikefarah/yq/" title="Go to repository" class="md-source" data-md-source="github">
|
||||||
|
|
||||||
|
<div class="md-source__icon">
|
||||||
|
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||||
|
<use xlink:href="#__github" width="24" height="24"></use>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="md-source__repository">
|
||||||
|
mikefarah/yq
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../.." title="Install" class="md-nav__link">
|
||||||
|
Install
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../../read/" title="Read" class="md-nav__link">
|
||||||
|
Read
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../../write/" title="Write/Update" class="md-nav__link">
|
||||||
|
Write/Update
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../../prefix/" title="Prefix" class="md-nav__link">
|
||||||
|
Prefix
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../../delete/" title="Delete" class="md-nav__link">
|
||||||
|
Delete
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../../create/" title="Create" class="md-nav__link">
|
||||||
|
Create
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../../convert/" title="Convert" class="md-nav__link">
|
||||||
|
Convert
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../../merge/" title="Merge" class="md-nav__link">
|
||||||
|
Merge
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="md-content">
|
||||||
|
<article class="md-content__inner md-typeset">
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://github.com/mikefarah/yq/edit/master/docs/snippets/works_with_json.md" title="Edit this page" class="md-icon md-content__icon"></a>
|
||||||
|
|
||||||
|
|
||||||
|
<h1>Works with json</h1>
|
||||||
|
|
||||||
|
<p>This command can take a json file as input too, and will output yaml unless specified to export as json (-j)</p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</article>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
|
||||||
|
<footer class="md-footer">
|
||||||
|
|
||||||
|
<div class="md-footer-meta md-typeset">
|
||||||
|
<div class="md-footer-meta__inner md-grid">
|
||||||
|
<div class="md-footer-copyright">
|
||||||
|
|
||||||
|
powered by
|
||||||
|
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||||
|
and
|
||||||
|
<a href="https://squidfunk.github.io/mkdocs-material/">
|
||||||
|
Material for MkDocs</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="md-footer-social">
|
||||||
|
<link rel="stylesheet" href="../../assets/fonts/font-awesome.css">
|
||||||
|
|
||||||
|
<a href="https://github.com/mikefarah" class="md-footer-social__link fa fa-github"></a>
|
||||||
|
|
||||||
|
<a href="https://www.linkedin.com/in/mike-farah-b5a75b2/" class="md-footer-social__link fa fa-linkedin"></a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="../../assets/javascripts/application.39abc4af.js"></script>
|
||||||
|
|
||||||
|
<script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -1,99 +1,147 @@
|
|||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html class="no-js">
|
|
||||||
|
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en" class="no-js">
|
||||||
<head>
|
<head>
|
||||||
|
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
|
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="shortcut icon" href="../assets/images/favicon.png">
|
<meta name="lang:clipboard.copy" content="Copy to clipboard">
|
||||||
|
|
||||||
<meta name="generator" content="mkdocs-0.16.3, mkdocs-material-1.5.4">
|
<meta name="lang:clipboard.copied" content="Copied to clipboard">
|
||||||
|
|
||||||
|
<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.one" content="1 matching document">
|
||||||
|
|
||||||
|
<meta name="lang:search.result.other" content="# matching documents">
|
||||||
|
|
||||||
|
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||||
|
|
||||||
|
<link rel="shortcut icon" href="../assets/images/favicon.png">
|
||||||
|
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.2.0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<title>Write/Update - Yaml</title>
|
<title>Write/Update - Yq</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script src="../assets/javascripts/modernizr-56ade86843.js"></script>
|
<link rel="stylesheet" href="../assets/stylesheets/application.750b69bd.css">
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../assets/stylesheets/application-b1a1975878.css">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<script src="../assets/javascripts/modernizr.74668098.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 dir="ltr">
|
||||||
|
|
||||||
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<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">
|
||||||
<div class="md-flex">
|
<div class="md-flex">
|
||||||
<div class="md-flex__cell md-flex__cell--shrink">
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
<a href=".." title="Yq" class="md-header-nav__button md-logo">
|
||||||
<a href=".." title="Yaml" class="md-icon md-icon--home md-header-nav__button">
|
|
||||||
</a>
|
<i class="md-icon"></i>
|
||||||
|
|
||||||
|
</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">
|
||||||
<span class="md-flex__ellipsis md-header-nav__title">
|
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
||||||
|
|
||||||
|
<span class="md-header-nav__topic">
|
||||||
|
Yq
|
||||||
|
</span>
|
||||||
Write/Update
|
<span class="md-header-nav__topic">
|
||||||
|
Write/Update
|
||||||
|
</span>
|
||||||
|
|
||||||
</span>
|
</div>
|
||||||
</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--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">
|
<div class="md-search" data-md-component="search" role="dialog">
|
||||||
<div class="md-search__overlay"></div>
|
<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" accesskey="s" 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">close</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>
|
||||||
<div class="md-search-result" data-md-component="result">
|
<div class="md-search-result" data-md-component="result">
|
||||||
<div class="md-search-result__meta" data-md-lang-result-none="No matching documents" data-md-lang-result-one="1 matching document" data-md-lang-result-other="# matching documents">
|
<div class="md-search-result__meta">
|
||||||
Type to start searching
|
Type to start searching
|
||||||
</div>
|
</div>
|
||||||
<ol class="md-search-result__list"></ol>
|
<ol class="md-search-result__list"></ol>
|
||||||
@@ -104,37 +152,37 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="md-flex__cell md-flex__cell--shrink">
|
|
||||||
<div class="md-header-nav__source">
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
|
<div class="md-header-nav__source">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://github.com/mikefarah/yq/" title="Go to repository" class="md-source" data-md-source="github">
|
||||||
<a href="https://github.com/mikefarah/yaml" title="Go to repository" class="md-source" data-md-source="github">
|
|
||||||
|
<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 class="md-source__repository">
|
|
||||||
mikefarah/yaml
|
|
||||||
</div>
|
</div>
|
||||||
</a>
|
|
||||||
|
<div class="md-source__repository">
|
||||||
|
mikefarah/yq
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div class="md-container">
|
<div class="md-container">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<main class="md-main">
|
<main class="md-main">
|
||||||
<div class="md-main__inner md-grid" data-md-component="container">
|
<div class="md-main__inner md-grid" data-md-component="container">
|
||||||
@@ -144,11 +192,13 @@
|
|||||||
<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">
|
||||||
|
<a href=".." title="Yq" class="md-nav__button md-logo">
|
||||||
<i class="md-icon md-icon--home md-nav__button"></i>
|
|
||||||
|
<i class="md-icon"></i>
|
||||||
Yaml
|
|
||||||
|
</a>
|
||||||
|
Yq
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<div class="md-nav__source">
|
<div class="md-nav__source">
|
||||||
@@ -157,20 +207,18 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://github.com/mikefarah/yq/" title="Go to repository" class="md-source" data-md-source="github">
|
||||||
<a href="https://github.com/mikefarah/yaml" title="Go to repository" class="md-source" data-md-source="github">
|
|
||||||
|
<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 class="md-source__repository">
|
|
||||||
mikefarah/yaml
|
|
||||||
</div>
|
</div>
|
||||||
</a>
|
|
||||||
|
<div class="md-source__repository">
|
||||||
|
mikefarah/yq
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ul class="md-nav__list" data-md-scrollfix>
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
@@ -208,10 +256,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>
|
||||||
|
|
||||||
@@ -224,7 +272,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">
|
||||||
@@ -246,6 +294,48 @@
|
|||||||
Adding new fields
|
Adding new fields
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#splat" title="Splat" class="md-nav__link">
|
||||||
|
Splat
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#prefix-splat" title="Prefix Splat" class="md-nav__link">
|
||||||
|
Prefix Splat
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#array-splat" title="Array Splat" class="md-nav__link">
|
||||||
|
Array Splat
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#appending-value-to-an-array-field" title="Appending value to an array field" class="md-nav__link">
|
||||||
|
Appending value to an array field
|
||||||
|
</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">
|
||||||
@@ -269,6 +359,22 @@
|
|||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#keys-with-dots" title="Keys with dots" class="md-nav__link">
|
||||||
|
Keys with dots
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#keys-and-values-with-leading-dashes" title="Keys (and values) with leading dashes" class="md-nav__link">
|
||||||
|
Keys (and values) with leading dashes
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
@@ -283,6 +389,30 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../prefix/" title="Prefix" class="md-nav__link">
|
||||||
|
Prefix
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../delete/" title="Delete" class="md-nav__link">
|
||||||
|
Delete
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<li class="md-nav__item">
|
<li class="md-nav__item">
|
||||||
<a href="../create/" title="Create" class="md-nav__link">
|
<a href="../create/" title="Create" class="md-nav__link">
|
||||||
Create
|
Create
|
||||||
@@ -302,6 +432,18 @@
|
|||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../merge/" title="Merge" class="md-nav__link">
|
||||||
|
Merge
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
@@ -317,7 +459,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">
|
||||||
@@ -339,6 +481,48 @@
|
|||||||
Adding new fields
|
Adding new fields
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#splat" title="Splat" class="md-nav__link">
|
||||||
|
Splat
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#prefix-splat" title="Prefix Splat" class="md-nav__link">
|
||||||
|
Prefix Splat
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#array-splat" title="Array Splat" class="md-nav__link">
|
||||||
|
Array Splat
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#appending-value-to-an-array-field" title="Appending value to an array field" class="md-nav__link">
|
||||||
|
Appending value to an array field
|
||||||
|
</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">
|
||||||
@@ -362,6 +546,22 @@
|
|||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#keys-with-dots" title="Keys with dots" class="md-nav__link">
|
||||||
|
Keys with dots
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="#keys-and-values-with-leading-dashes" title="Keys (and values) with leading dashes" class="md-nav__link">
|
||||||
|
Keys (and values) with leading dashes
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
@@ -376,13 +576,14 @@
|
|||||||
<article class="md-content__inner md-typeset">
|
<article class="md-content__inner md-typeset">
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://github.com/mikefarah/yq/edit/master/docs/write.md" title="Edit this page" class="md-icon md-content__icon"></a>
|
||||||
|
|
||||||
|
|
||||||
<h1>Write/Update</h1>
|
<h1>Write/Update</h1>
|
||||||
|
|
||||||
<pre><code>yaml 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:
|
||||||
@@ -390,7 +591,7 @@
|
|||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>then</p>
|
<p>then</p>
|
||||||
<pre><code class="bash">yaml w sample.yaml b.c cat
|
<pre><code class="bash">yq w sample.yaml b.c cat
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>will output:</p>
|
<p>will output:</p>
|
||||||
@@ -399,7 +600,7 @@
|
|||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<h3 id="from-stdin">From STDIN<a class="headerlink" href="#from-stdin" title="Permanent link">¶</a></h3>
|
<h3 id="from-stdin">From STDIN<a class="headerlink" href="#from-stdin" title="Permanent link">¶</a></h3>
|
||||||
<pre><code class="bash">cat sample.yaml | yaml w - b.c blah
|
<pre><code class="bash">cat sample.yaml | yq w - b.c blah
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<h3 id="adding-new-fields">Adding new fields<a class="headerlink" href="#adding-new-fields" title="Permanent link">¶</a></h3>
|
<h3 id="adding-new-fields">Adding new fields<a class="headerlink" href="#adding-new-fields" title="Permanent link">¶</a></h3>
|
||||||
@@ -410,7 +611,7 @@
|
|||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>then</p>
|
<p>then</p>
|
||||||
<pre><code class="bash">yaml w sample.yaml b.d[0] "new thing"
|
<pre><code class="bash">yq w sample.yaml b.d[+] "new thing"
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>will output:</p>
|
<p>will output:</p>
|
||||||
@@ -420,6 +621,145 @@
|
|||||||
- new thing
|
- new thing
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
|
<h3 id="splat">Splat<a class="headerlink" href="#splat" title="Permanent link">¶</a></h3>
|
||||||
|
<p>Given a sample.yaml file of:</p>
|
||||||
|
<pre><code class="yaml">---
|
||||||
|
bob:
|
||||||
|
item1:
|
||||||
|
cats: bananas
|
||||||
|
item2:
|
||||||
|
cats: apples
|
||||||
|
thing:
|
||||||
|
cats: oranges
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>then</p>
|
||||||
|
<pre><code class="bash">yq w sample.yaml bob.*.cats meow
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>will output:</p>
|
||||||
|
<pre><code class="yaml">---
|
||||||
|
bob:
|
||||||
|
item1:
|
||||||
|
cats: meow
|
||||||
|
item2:
|
||||||
|
cats: meow
|
||||||
|
thing:
|
||||||
|
cats: meow
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<h3 id="prefix-splat">Prefix Splat<a class="headerlink" href="#prefix-splat" title="Permanent link">¶</a></h3>
|
||||||
|
<p>Given a sample.yaml file of:</p>
|
||||||
|
<pre><code class="yaml">---
|
||||||
|
bob:
|
||||||
|
item1:
|
||||||
|
cats: bananas
|
||||||
|
item2:
|
||||||
|
cats: apples
|
||||||
|
thing:
|
||||||
|
cats: oranges
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>then</p>
|
||||||
|
<pre><code class="bash">yq w sample.yaml bob.item*.cats meow
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>will output:</p>
|
||||||
|
<pre><code class="yaml">---
|
||||||
|
bob:
|
||||||
|
item1:
|
||||||
|
cats: meow
|
||||||
|
item2:
|
||||||
|
cats: meow
|
||||||
|
thing:
|
||||||
|
cats: oranges
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<h3 id="array-splat">Array Splat<a class="headerlink" href="#array-splat" title="Permanent link">¶</a></h3>
|
||||||
|
<p>Given a sample.yaml file of:</p>
|
||||||
|
<pre><code class="yaml">---
|
||||||
|
bob:
|
||||||
|
- cats: bananas
|
||||||
|
- cats: apples
|
||||||
|
- cats: oranges
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>then</p>
|
||||||
|
<pre><code class="bash">yq w sample.yaml bob[*].cats meow
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>will output:</p>
|
||||||
|
<pre><code class="yaml">---
|
||||||
|
bob:
|
||||||
|
- cats: meow
|
||||||
|
- cats: meow
|
||||||
|
- cats: meow
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<h3 id="appending-value-to-an-array-field">Appending value to an array field<a class="headerlink" href="#appending-value-to-an-array-field" title="Permanent link">¶</a></h3>
|
||||||
|
<p>Given a sample.yaml file of:</p>
|
||||||
|
<pre><code class="yaml">b:
|
||||||
|
c: 2
|
||||||
|
d:
|
||||||
|
- new thing
|
||||||
|
- foo thing
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>then</p>
|
||||||
|
<pre><code class="bash">yq w sample.yaml "b.d[+]" "bar thing"
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>will output:</p>
|
||||||
|
<pre><code class="yaml">b:
|
||||||
|
c: cat
|
||||||
|
d:
|
||||||
|
- new thing
|
||||||
|
- foo thing
|
||||||
|
- bar thing
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<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:
|
||||||
@@ -427,7 +767,7 @@
|
|||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>then</p>
|
<p>then</p>
|
||||||
<pre><code class="bash">yaml w -i sample.yaml b.c cat
|
<pre><code class="bash">yq w -i sample.yaml b.c cat
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>will update the sample.yaml file so that the value of 'c' is cat.</p>
|
<p>will update the sample.yaml file so that the value of 'c' is cat.</p>
|
||||||
@@ -441,11 +781,11 @@
|
|||||||
|
|
||||||
<p>and a script update_instructions.yaml of:</p>
|
<p>and a script update_instructions.yaml of:</p>
|
||||||
<pre><code class="yaml">b.c: 3
|
<pre><code class="yaml">b.c: 3
|
||||||
b.e[0].name: Howdy Partner
|
b.e[+].name: Howdy Partner
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>then</p>
|
<p>then</p>
|
||||||
<pre><code class="bash">yaml w -s update_instructions.yaml sample.yaml
|
<pre><code class="bash">yq w -s update_instructions.yaml sample.yaml
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>will output:</p>
|
<p>will output:</p>
|
||||||
@@ -456,24 +796,50 @@ b.e[0].name: Howdy Partner
|
|||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>And, of course, you can pipe the instructions in using '-':</p>
|
<p>And, of course, you can pipe the instructions in using '-':</p>
|
||||||
<pre><code class="bash">cat update_instructions.yaml | yaml w -s - sample.yaml
|
<pre><code class="bash">cat update_instructions.yaml | yq w -s - sample.yaml
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<h3 id="values-starting-with-a-hyphen-or-dash">Values starting with a hyphen (or dash)<a class="headerlink" href="#values-starting-with-a-hyphen-or-dash" title="Permanent link">¶</a></h3>
|
<h3 id="values-starting-with-a-hyphen-or-dash">Values starting with a hyphen (or dash)<a class="headerlink" href="#values-starting-with-a-hyphen-or-dash" title="Permanent link">¶</a></h3>
|
||||||
<p>The flag terminator needs to be used to stop the app from attempting to parse the subsequent arguments as flags:</p>
|
<p>The flag terminator needs to be used to stop the app from attempting to parse the subsequent arguments as flags:</p>
|
||||||
<pre><code>yaml w -- my.path -3
|
<pre><code>yq w -- my.path -3
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>will output</p>
|
<p>will output</p>
|
||||||
<pre><code class="yaml">my:
|
<pre><code class="yaml">my:
|
||||||
path: -3
|
path: -3
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
<pre><code class="yaml">b:
|
||||||
|
foo.bar: 7
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<pre><code class="bash">yaml r sample.yaml 'b[foo.bar]'
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<pre><code class="bash">yaml w sample.yaml 'b[foo.bar]' 9
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>Any valid yaml key can be specified as part of a key lookup.</p>
|
||||||
|
<p>Note that the path is in quotes to avoid the square brackets being interpreted by your shell.</p>
|
||||||
|
<h3 id="keys-and-values-with-leading-dashes">Keys (and values) with leading dashes<a class="headerlink" href="#keys-and-values-with-leading-dashes" title="Permanent link">¶</a></h3>
|
||||||
|
<p>If a key or value has leading dashes, yq won't know that you are passing a value as opposed to a flag (and you will get a 'bad flag syntax' error).</p>
|
||||||
|
<p>To fix that, you will need to tell it to stop processing flags by adding '--' after the last flag like so:</p>
|
||||||
|
<pre><code class="bash">yq n -t -- --key --value
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>Will result in</p>
|
||||||
|
<p><code>`
|
||||||
|
--key: --value</code></p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
@@ -501,13 +867,13 @@ b.e[0].name: Howdy Partner
|
|||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
|
||||||
<a href="../create/" title="Create" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
|
<a href="../prefix/" title="Prefix" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
|
||||||
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
|
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
|
||||||
<span class="md-flex__ellipsis">
|
<span class="md-flex__ellipsis">
|
||||||
<span class="md-footer-nav__direction">
|
<span class="md-footer-nav__direction">
|
||||||
Next
|
Next
|
||||||
</span>
|
</span>
|
||||||
Create
|
Prefix
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="md-flex__cell md-flex__cell--shrink">
|
<div class="md-flex__cell md-flex__cell--shrink">
|
||||||
@@ -523,16 +889,14 @@ 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" title="MkDocs">MkDocs</a>
|
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||||
and
|
and
|
||||||
<a href="http://squidfunk.github.io/mkdocs-material/" title="Material for MkDocs">
|
<a href="https://squidfunk.github.io/mkdocs-material/">
|
||||||
Material for MkDocs</a>
|
Material for MkDocs</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<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>
|
||||||
|
|
||||||
@@ -540,18 +904,15 @@ b.e[0].name: Howdy Partner
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="../assets/javascripts/application-0b7df094bf.js"></script>
|
<script src="../assets/javascripts/application.39abc4af.js"></script>
|
||||||
<script>app.initialize({url:{base:".."}})</script>
|
|
||||||
|
|
||||||
|
<script>app.initialize({version:"1.0.4",url:{base:".."}})</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
9
examples/array.yaml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
- become: true
|
||||||
|
gather_facts: false
|
||||||
|
hosts: lalaland
|
||||||
|
name: "Apply smth"
|
||||||
|
roles:
|
||||||
|
- lala
|
||||||
|
- land
|
||||||
|
serial: 1
|
||||||
2
examples/data1.yaml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
a: simple
|
||||||
|
b: [1, 2]
|
||||||
4
examples/data2.yaml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
a: other
|
||||||
|
b: [3, 4]
|
||||||
|
c:
|
||||||
|
test: 1
|
||||||
14
examples/data3.yaml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
deep1:
|
||||||
|
hostA:
|
||||||
|
value: 1234
|
||||||
|
notRelevant:
|
||||||
|
value: bananas
|
||||||
|
hostB:
|
||||||
|
value: 5678
|
||||||
|
deep2:
|
||||||
|
hostC:
|
||||||
|
value: 1234
|
||||||
|
notRelevant:
|
||||||
|
value: bananas
|
||||||
|
hostD:
|
||||||
|
value: 5678
|
||||||
2
examples/empty.yaml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# a: apple
|
||||||
|
# b: cat
|
||||||
2
examples/instruction_sample.yaml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
b.c: cat
|
||||||
|
b.e[+].name: Mike Farah
|
||||||
5
examples/multiline-text.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
test: |
|
||||||
|
abcdefg
|
||||||
|
hijklmno
|
||||||
|
|
||||||
|
|
||||||
18
examples/multiple_docs.yaml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
commonKey: first document
|
||||||
|
a: Easy! as one two three
|
||||||
|
b:
|
||||||
|
c: 2
|
||||||
|
d: [3, 4]
|
||||||
|
e:
|
||||||
|
- name: fred
|
||||||
|
value: 3
|
||||||
|
- name: sam
|
||||||
|
value: 4
|
||||||
|
---
|
||||||
|
commonKey: second document
|
||||||
|
another:
|
||||||
|
document: here
|
||||||
|
---
|
||||||
|
commonKey: third document
|
||||||
|
wow:
|
||||||
|
- here is another
|
||||||
7
examples/multiple_docs_small.yaml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
a: Easy! as one two three
|
||||||
|
---
|
||||||
|
another:
|
||||||
|
document: here
|
||||||
|
---
|
||||||
|
- 1
|
||||||
|
- 2
|
||||||
2
examples/numbered_keys.yml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
5:
|
||||||
|
6: camel!
|
||||||