config.yml 中的 dlv 替代路径示例
dlv substitute-path example in config.yml
在 $HOME/.dlv/config.yml 中设置起点和终点路径的任何示例?我试过设置:
案例 1(在 from 和 to 中加上引号)
替代路径:
{"from":
"/private/var/tmp/_bazel/d3eb9a0ef06857aebc54b41ff425d2ee"
"to": "/Users/xxx/code/src"}
案例 2:(在 from 和 to 中没有引号)
替代路径:
{from:
"/private/var/tmp/_bazel/d3eb9a0ef06857aebc54b41ff425d2ee"
to: "/Users/xxx/code/src"}
案例 2:('{from' 前有连字符)
替代路径:
-{from:
"/private/var/tmp/_bazel/d3eb9a0ef06857aebc54b41ff425d2ee"
to: "/Users/xxx/code/src"}
案例 2:('{from' 前有连字符)
替代路径:
-{"from":
"/private/var/tmp/_bazel/d3eb9a0ef06857aebc54b41ff425d2ee"
"to": "/Users/xxx/code/src"}
所有 4 个案例均因配置而失败。错误。
任何设置路径的工作示例?
我认为您缺少 space。仅当值或键中包含 space 或其他一些 non-printable、non-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.
在 $HOME/.dlv/config.yml 中设置起点和终点路径的任何示例?我试过设置:
案例 1(在 from 和 to 中加上引号) 替代路径:
{"from":
"/private/var/tmp/_bazel/d3eb9a0ef06857aebc54b41ff425d2ee"
"to": "/Users/xxx/code/src"}
案例 2:(在 from 和 to 中没有引号) 替代路径:
{from:
"/private/var/tmp/_bazel/d3eb9a0ef06857aebc54b41ff425d2ee"
to: "/Users/xxx/code/src"}
案例 2:('{from' 前有连字符) 替代路径:
-{from:
"/private/var/tmp/_bazel/d3eb9a0ef06857aebc54b41ff425d2ee"
to: "/Users/xxx/code/src"}
案例 2:('{from' 前有连字符) 替代路径:
-{"from":
"/private/var/tmp/_bazel/d3eb9a0ef06857aebc54b41ff425d2ee"
"to": "/Users/xxx/code/src"}
所有 4 个案例均因配置而失败。错误。 任何设置路径的工作示例?
我认为您缺少 space。仅当值或键中包含 space 或其他一些 non-printable、non-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.