在运行cargo
后,cargo build
打印要输出的文件列表的命令是什么?
答案 0 :(得分:2)
cargo read-manifest
将打印一个包含您可以使用的targets
密钥的JSON对象。使用jq
过滤和漂亮打印,这是rustfmt
包装箱结帐时的输出:
➜ cargo read-manifest | jq '.targets'
[
{
"kind": [
"lib"
],
"name": "rustfmt",
"src_path": "/Users/.../rustfmt/src/lib.rs"
},
{
"kind": [
"bin"
],
"name": "cargo-fmt",
"src_path": "/Users/.../rustfmt/src/bin/cargo-fmt.rs"
},
{
"kind": [
"bin"
],
"name": "rustfmt",
"src_path": "/Users/.../rustfmt/src/bin/rustfmt.rs"
},
{
"kind": [
"custom-build"
],
"name": "build-script-build",
"src_path": "build.rs"
},
{
"kind": [
"test"
],
"name": "system",
"src_path": "/Users/.../rustfmt/tests/system.rs"
}
]