1 回答
TA贡献1911条经验 获得超7个赞
我认为你缺少一个空间。仅当值或键中有空格或其他一些不可打印的非 ascii 字符时,引号才相关。
这里的配置,没有注释:
$ cat ~/.config/dlv/config.yml | sed '/^#/d; /^$/d'
aliases:
# command: ["alias1", "alias2"]
substitute-path:
- {from: /my/source/code/was/here, to: /but/now/its/here}
debug-info-directories: ["/usr/lib/debug/.build-id"]
似乎是有效的 yaml:
$ yq < ~/.config/dlv/config.yml
{
"aliases": null,
"substitute-path": [
{
"from": "/my/source/code/was/here",
"to": "/but/now/its/here"
}
],
"debug-info-directories": [
"/usr/lib/debug/.build-id"
]
}
yq 工具是 jq 的包装器。
$ yq --help | sed 8q
usage: yq [options] <jq filter> [input file...]
[jq_filter] [files [files ...]]
yq: Command-line YAML processor - jq wrapper for YAML documents
yq transcodes YAML documents to JSON and passes them to jq.
See https://github.com/kislyuk/yq for more information.
- 1 回答
- 0 关注
- 367 浏览
添加回答
举报
