cargo-verify-project(1)
NAME
cargo-verify-project - Check correctness of crate manifest
SYNOPSIS
cargo verify-project [options]
DESCRIPTION
This command will parse the local manifest and check its validity. It emits a JSON object with the result. A successful validation will display:
{"success":"true"}
An invalid workspace will display:
{"invalid":"human-readable error message"}
OPTIONS
Display Options
-v--verbose- 启用更加详细的输出。可两次使用来显示"非常详细"的输出,其中包含了诸如 依赖警告 以及 构建脚本输出 等额外的输出内容。
也可通过
term.verbose指定。 config value. -q--quiet- 不输出Cargo的日志信息。也可通过
term.quiet指定。 config value. --colorwhen- 控制输出内容的颜色。有效取值如下:
auto(默认):自动检测终端是否支持带颜色的输出。always:总显示带颜色的输出。never:从不显示带颜色的输出。
也可通过
term.color指定。 config value.
Manifest Options
--manifest-pathpath- 用于指定
Cargo.toml文件的路径。默认情况下,Cargo会在当前目录或上级目录中寻找Cargo.toml文件。 --frozen--locked- 这两个选项用于保证
Cargo.lock文件是最新的。如果该锁文件不存在,或者不是最新的,Cargo 会报错退出。其中--frozen选项会阻止Cargo访问网络以检查锁文件是否是最新的。这些选项,可用于保证
Cargo.lock文件是最新的(比如持续集成的构建过程), 或用于避免联网。 --offline- 禁止Cargo访问网络。如果不添加此选项,Cargo在需要访问网络但网络不可用的情况下,会报错
并停止工作。添加此选项后,Cargo会尽可能尝试不使用网络来工作。
注意,在此情况下可能会产生与联网状态下不同的依赖解析(Dependency Resolution)结果。 Cargo只会使用本地已下载的crate,即便本地的索引副本中表明可能有新版本crate。在离线前下载 所需依赖的方法,参见 cargo-fetch(1) 。
也可以通过
net.offlineconfig value指定。
Common Options
+toolchain- If Cargo has been installed with rustup, and the first argument to
cargobegins with+, it will be interpreted as a rustup toolchain name (such as+stableor+nightly). See the rustup documentation for more information about how toolchain overrides work. -h--help- Prints help information.
-Zflag- Unstable (nightly-only) flags to Cargo. Run
cargo -Z helpfor details.
环境
关于Cargo所读取的环境变量,可参见the reference
EXIT STATUS
0: The workspace is OK.1: The workspace is invalid.
EXAMPLES
-
Check the current workspace for errors:
cargo verify-project