mirror of
https://github.com/rust-lang/cargo
synced 2024-08-28 03:39:31 +00:00
Auto merge of #11912 - epage:help, r=ehuss
test(cli): Track --help output ### What does this PR try to resolve? This makes it easier to evaluate the usability of PRs, like #11905 This follows the pattern of `cargo add` and `cargo remove` of putting these ui tests in `cargo_<cmd>/` directories. `init` didn't follow this pattern, so it was renamed to `cargo_init/`. `cargo_config.rs` was going to conflict with this, it was merged in. We can evaluate other `<cmd>.rs` files at a later point and consolidate. ### How should we test and review this PR? The main risks are - Are all files linked together (`main.rs` -> `<cmd>/mod.rs` -> `<cmd>/<help>.rs` - Are all `help/mod.rs`s pointing to the right command
This commit is contained in:
commit
e2fbcd9f77
12
tests/testsuite/cargo/help/mod.rs
Normal file
12
tests/testsuite/cargo/help/mod.rs
Normal file
|
@ -0,0 +1,12 @@
|
|||
use cargo_test_support::curr_dir;
|
||||
use cargo_test_support::prelude::*;
|
||||
|
||||
#[cargo_test]
|
||||
fn case() {
|
||||
snapbox::cmd::Command::cargo_ui()
|
||||
.arg("--help")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout_matches_path(curr_dir!().join("stdout.log"))
|
||||
.stderr_matches_path(curr_dir!().join("stderr.log"));
|
||||
}
|
0
tests/testsuite/cargo/help/stderr.log
Normal file
0
tests/testsuite/cargo/help/stderr.log
Normal file
39
tests/testsuite/cargo/help/stdout.log
Normal file
39
tests/testsuite/cargo/help/stdout.log
Normal file
|
@ -0,0 +1,39 @@
|
|||
Rust's package manager
|
||||
|
||||
Usage: cargo [+toolchain] [OPTIONS] [COMMAND]
|
||||
cargo [+toolchain] [OPTIONS] -Zscript <MANIFEST_RS> [ARGS]...
|
||||
|
||||
Options:
|
||||
-h, --help Print help
|
||||
-V, --version Print version info and exit
|
||||
--list List installed commands
|
||||
--explain <CODE> Run `rustc --explain CODE`
|
||||
-v, --verbose... Use verbose output (-vv very verbose/build.rs output)
|
||||
-q, --quiet Do not print cargo log messages
|
||||
--color <WHEN> Coloring: auto, always, never
|
||||
-C <DIRECTORY> Change to DIRECTORY before doing anything (nightly-only)
|
||||
--frozen Require Cargo.lock and cache are up to date
|
||||
--locked Require Cargo.lock is up to date
|
||||
--offline Run without accessing the network
|
||||
--config <KEY=VALUE> Override a configuration value
|
||||
-Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
|
||||
|
||||
Some common cargo commands are (see all commands with --list):
|
||||
build, b Compile the current package
|
||||
check, c Analyze the current package and report errors, but don't build object files
|
||||
clean Remove the target directory
|
||||
doc, d Build this package's and its dependencies' documentation
|
||||
new Create a new cargo package
|
||||
init Create a new cargo package in an existing directory
|
||||
add Add dependencies to a manifest file
|
||||
remove Remove dependencies from a manifest file
|
||||
run, r Run a binary or example of the local package
|
||||
test, t Run the tests
|
||||
bench Run the benchmarks
|
||||
update Update dependencies listed in Cargo.lock
|
||||
search Search registry for crates
|
||||
publish Package and upload this package to the registry
|
||||
install Install a Rust binary. Default location is $HOME/.cargo/bin
|
||||
uninstall Uninstall a Rust binary
|
||||
|
||||
See 'cargo help <command>' for more information on a specific command.
|
1
tests/testsuite/cargo/mod.rs
Normal file
1
tests/testsuite/cargo/mod.rs
Normal file
|
@ -0,0 +1 @@
|
|||
mod help;
|
13
tests/testsuite/cargo_add/help/mod.rs
Normal file
13
tests/testsuite/cargo_add/help/mod.rs
Normal file
|
@ -0,0 +1,13 @@
|
|||
use cargo_test_support::curr_dir;
|
||||
use cargo_test_support::prelude::*;
|
||||
|
||||
#[cargo_test]
|
||||
fn case() {
|
||||
snapbox::cmd::Command::cargo_ui()
|
||||
.arg("add")
|
||||
.arg("--help")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout_matches_path(curr_dir!().join("stdout.log"))
|
||||
.stderr_matches_path(curr_dir!().join("stderr.log"));
|
||||
}
|
0
tests/testsuite/cargo_add/help/stderr.log
Normal file
0
tests/testsuite/cargo_add/help/stderr.log
Normal file
122
tests/testsuite/cargo_add/help/stdout.log
Normal file
122
tests/testsuite/cargo_add/help/stdout.log
Normal file
|
@ -0,0 +1,122 @@
|
|||
Add dependencies to a Cargo.toml manifest file
|
||||
|
||||
Usage: cargo add [OPTIONS] <DEP>[@<VERSION>] ...
|
||||
cargo add [OPTIONS] --path <PATH> ...
|
||||
cargo add [OPTIONS] --git <URL> ...
|
||||
|
||||
Arguments:
|
||||
[DEP_ID]...
|
||||
Reference to a package to add as a dependency
|
||||
|
||||
You can reference a package by:
|
||||
- `<name>`, like `cargo add serde` (latest version will be used)
|
||||
- `<name>@<version-req>`, like `cargo add serde@1` or `cargo add serde@=1.0.38`
|
||||
|
||||
Options:
|
||||
--no-default-features
|
||||
Disable the default features
|
||||
|
||||
--default-features
|
||||
Re-enable the default features
|
||||
|
||||
-F, --features <FEATURES>
|
||||
Space or comma separated list of features to activate
|
||||
|
||||
--optional
|
||||
Mark the dependency as optional
|
||||
|
||||
The package name will be exposed as feature of your crate.
|
||||
|
||||
--no-optional
|
||||
Mark the dependency as required
|
||||
|
||||
The package will be removed from your features.
|
||||
|
||||
--rename <NAME>
|
||||
Rename the dependency
|
||||
|
||||
Example uses:
|
||||
- Depending on multiple versions of a crate
|
||||
- Depend on crates with the same name from different registries
|
||||
|
||||
--ignore-rust-version
|
||||
Ignore `rust-version` specification in packages (unstable)
|
||||
|
||||
--manifest-path <PATH>
|
||||
Path to Cargo.toml
|
||||
|
||||
-p, --package [<SPEC>]
|
||||
Package to modify
|
||||
|
||||
-q, --quiet
|
||||
Do not print cargo log messages
|
||||
|
||||
--dry-run
|
||||
Don't actually write the manifest
|
||||
|
||||
-h, --help
|
||||
Print help (see a summary with '-h')
|
||||
|
||||
-v, --verbose...
|
||||
Use verbose output (-vv very verbose/build.rs output)
|
||||
|
||||
--color <WHEN>
|
||||
Coloring: auto, always, never
|
||||
|
||||
--frozen
|
||||
Require Cargo.lock and cache are up to date
|
||||
|
||||
--locked
|
||||
Require Cargo.lock is up to date
|
||||
|
||||
--offline
|
||||
Run without accessing the network
|
||||
|
||||
--config <KEY=VALUE>
|
||||
Override a configuration value
|
||||
|
||||
-Z <FLAG>
|
||||
Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
|
||||
|
||||
Source:
|
||||
--path <PATH>
|
||||
Filesystem path to local crate to add
|
||||
|
||||
--git <URI>
|
||||
Git repository location
|
||||
|
||||
Without any other information, cargo will use latest commit on the main branch.
|
||||
|
||||
--branch <BRANCH>
|
||||
Git branch to download the crate from
|
||||
|
||||
--tag <TAG>
|
||||
Git tag to download the crate from
|
||||
|
||||
--rev <REV>
|
||||
Git reference to download the crate from
|
||||
|
||||
This is the catch all, handling hashes to named references in remote repositories.
|
||||
|
||||
--registry <NAME>
|
||||
Package registry for this dependency
|
||||
|
||||
Section:
|
||||
--dev
|
||||
Add as development dependency
|
||||
|
||||
Dev-dependencies are not used when compiling a package for building, but are used for
|
||||
compiling tests, examples, and benchmarks.
|
||||
|
||||
These dependencies are not propagated to other packages which depend on this package.
|
||||
|
||||
--build
|
||||
Add as build dependency
|
||||
|
||||
Build-dependencies are the only dependencies available for use by build scripts
|
||||
(`build.rs` files).
|
||||
|
||||
--target <TARGET>
|
||||
Add as dependency to the given target platform
|
||||
|
||||
Run `cargo help add` for more detailed information.
|
|
@ -35,6 +35,7 @@ mod git_normalized_name;
|
|||
mod git_registry;
|
||||
mod git_rev;
|
||||
mod git_tag;
|
||||
mod help;
|
||||
mod infer_prerelease;
|
||||
mod invalid_arg;
|
||||
mod invalid_git_name;
|
||||
|
|
13
tests/testsuite/cargo_bench/help/mod.rs
Normal file
13
tests/testsuite/cargo_bench/help/mod.rs
Normal file
|
@ -0,0 +1,13 @@
|
|||
use cargo_test_support::curr_dir;
|
||||
use cargo_test_support::prelude::*;
|
||||
|
||||
#[cargo_test]
|
||||
fn case() {
|
||||
snapbox::cmd::Command::cargo_ui()
|
||||
.arg("bench")
|
||||
.arg("--help")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout_matches_path(curr_dir!().join("stdout.log"))
|
||||
.stderr_matches_path(curr_dir!().join("stderr.log"));
|
||||
}
|
0
tests/testsuite/cargo_bench/help/stderr.log
Normal file
0
tests/testsuite/cargo_bench/help/stderr.log
Normal file
50
tests/testsuite/cargo_bench/help/stdout.log
Normal file
50
tests/testsuite/cargo_bench/help/stdout.log
Normal file
|
@ -0,0 +1,50 @@
|
|||
Execute all benchmarks of a local package
|
||||
|
||||
Usage: cargo[EXE] bench [OPTIONS] [BENCHNAME] [-- [args]...]
|
||||
|
||||
Arguments:
|
||||
[BENCHNAME] If specified, only run benches containing this string in their names
|
||||
[args]... Arguments for the bench binary
|
||||
|
||||
Options:
|
||||
-q, --quiet Do not print cargo log messages
|
||||
--lib Benchmark only this package's library
|
||||
--bins Benchmark all binaries
|
||||
--bin [<NAME>] Benchmark only the specified binary
|
||||
--examples Benchmark all examples
|
||||
--example [<NAME>] Benchmark only the specified example
|
||||
--tests Benchmark all tests
|
||||
--test [<NAME>] Benchmark only the specified test target
|
||||
--benches Benchmark all benches
|
||||
--bench [<NAME>] Benchmark only the specified bench target
|
||||
--all-targets Benchmark all targets
|
||||
--no-run Compile, but don't run benchmarks
|
||||
-p, --package [<SPEC>] Package to run benchmarks for
|
||||
--workspace Benchmark all packages in the workspace
|
||||
--exclude <SPEC> Exclude packages from the benchmark
|
||||
--all Alias for --workspace (deprecated)
|
||||
-j, --jobs <N> Number of parallel jobs, defaults to # of CPUs.
|
||||
--keep-going Do not abort the build as soon as there is an error (unstable)
|
||||
--profile <PROFILE-NAME> Build artifacts with the specified profile
|
||||
-F, --features <FEATURES> Space or comma separated list of features to activate
|
||||
--all-features Activate all available features
|
||||
--no-default-features Do not activate the `default` feature
|
||||
--target <TRIPLE> Build for the target triple
|
||||
--target-dir <DIRECTORY> Directory for all generated artifacts
|
||||
--manifest-path <PATH> Path to Cargo.toml
|
||||
--ignore-rust-version Ignore `rust-version` specification in packages
|
||||
--message-format <FMT> Error format
|
||||
--no-fail-fast Run all benchmarks regardless of failure
|
||||
--unit-graph Output build graph in JSON (unstable)
|
||||
--timings[=<FMTS>] Timing output formats (unstable) (comma separated): html, json
|
||||
-h, --help Print help
|
||||
-v, --verbose... Use verbose output (-vv very verbose/build.rs output)
|
||||
--color <WHEN> Coloring: auto, always, never
|
||||
--frozen Require Cargo.lock and cache are up to date
|
||||
--locked Require Cargo.lock is up to date
|
||||
--offline Run without accessing the network
|
||||
--config <KEY=VALUE> Override a configuration value
|
||||
-Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for
|
||||
details
|
||||
|
||||
Run `cargo help bench` for more detailed information.
|
1
tests/testsuite/cargo_bench/mod.rs
Normal file
1
tests/testsuite/cargo_bench/mod.rs
Normal file
|
@ -0,0 +1 @@
|
|||
mod help;
|
13
tests/testsuite/cargo_build/help/mod.rs
Normal file
13
tests/testsuite/cargo_build/help/mod.rs
Normal file
|
@ -0,0 +1,13 @@
|
|||
use cargo_test_support::curr_dir;
|
||||
use cargo_test_support::prelude::*;
|
||||
|
||||
#[cargo_test]
|
||||
fn case() {
|
||||
snapbox::cmd::Command::cargo_ui()
|
||||
.arg("build")
|
||||
.arg("--help")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout_matches_path(curr_dir!().join("stdout.log"))
|
||||
.stderr_matches_path(curr_dir!().join("stderr.log"));
|
||||
}
|
0
tests/testsuite/cargo_build/help/stderr.log
Normal file
0
tests/testsuite/cargo_build/help/stderr.log
Normal file
48
tests/testsuite/cargo_build/help/stdout.log
Normal file
48
tests/testsuite/cargo_build/help/stdout.log
Normal file
|
@ -0,0 +1,48 @@
|
|||
Compile a local package and all of its dependencies
|
||||
|
||||
Usage: cargo[EXE] build [OPTIONS]
|
||||
|
||||
Options:
|
||||
-q, --quiet Do not print cargo log messages
|
||||
-p, --package [<SPEC>] Package to build (see `cargo help pkgid`)
|
||||
--workspace Build all packages in the workspace
|
||||
--exclude <SPEC> Exclude packages from the build
|
||||
--all Alias for --workspace (deprecated)
|
||||
-j, --jobs <N> Number of parallel jobs, defaults to # of CPUs.
|
||||
--keep-going Do not abort the build as soon as there is an error (unstable)
|
||||
--lib Build only this package's library
|
||||
--bins Build all binaries
|
||||
--bin [<NAME>] Build only the specified binary
|
||||
--examples Build all examples
|
||||
--example [<NAME>] Build only the specified example
|
||||
--tests Build all tests
|
||||
--test [<NAME>] Build only the specified test target
|
||||
--benches Build all benches
|
||||
--bench [<NAME>] Build only the specified bench target
|
||||
--all-targets Build all targets
|
||||
-r, --release Build artifacts in release mode, with optimizations
|
||||
--profile <PROFILE-NAME> Build artifacts with the specified profile
|
||||
-F, --features <FEATURES> Space or comma separated list of features to activate
|
||||
--all-features Activate all available features
|
||||
--no-default-features Do not activate the `default` feature
|
||||
--target <TRIPLE> Build for the target triple
|
||||
--target-dir <DIRECTORY> Directory for all generated artifacts
|
||||
--out-dir <PATH> Copy final artifacts to this directory (unstable)
|
||||
--manifest-path <PATH> Path to Cargo.toml
|
||||
--ignore-rust-version Ignore `rust-version` specification in packages
|
||||
--message-format <FMT> Error format
|
||||
--build-plan Output the build plan in JSON (unstable)
|
||||
--unit-graph Output build graph in JSON (unstable)
|
||||
--future-incompat-report Outputs a future incompatibility report at the end of the build
|
||||
--timings[=<FMTS>] Timing output formats (unstable) (comma separated): html, json
|
||||
-h, --help Print help
|
||||
-v, --verbose... Use verbose output (-vv very verbose/build.rs output)
|
||||
--color <WHEN> Coloring: auto, always, never
|
||||
--frozen Require Cargo.lock and cache are up to date
|
||||
--locked Require Cargo.lock is up to date
|
||||
--offline Run without accessing the network
|
||||
--config <KEY=VALUE> Override a configuration value
|
||||
-Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for
|
||||
details
|
||||
|
||||
Run `cargo help build` for more detailed information.
|
1
tests/testsuite/cargo_build/mod.rs
Normal file
1
tests/testsuite/cargo_build/mod.rs
Normal file
|
@ -0,0 +1 @@
|
|||
mod help;
|
13
tests/testsuite/cargo_check/help/mod.rs
Normal file
13
tests/testsuite/cargo_check/help/mod.rs
Normal file
|
@ -0,0 +1,13 @@
|
|||
use cargo_test_support::curr_dir;
|
||||
use cargo_test_support::prelude::*;
|
||||
|
||||
#[cargo_test]
|
||||
fn case() {
|
||||
snapbox::cmd::Command::cargo_ui()
|
||||
.arg("check")
|
||||
.arg("--help")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout_matches_path(curr_dir!().join("stdout.log"))
|
||||
.stderr_matches_path(curr_dir!().join("stderr.log"));
|
||||
}
|
0
tests/testsuite/cargo_check/help/stderr.log
Normal file
0
tests/testsuite/cargo_check/help/stderr.log
Normal file
46
tests/testsuite/cargo_check/help/stdout.log
Normal file
46
tests/testsuite/cargo_check/help/stdout.log
Normal file
|
@ -0,0 +1,46 @@
|
|||
Check a local package and all of its dependencies for errors
|
||||
|
||||
Usage: cargo[EXE] check [OPTIONS]
|
||||
|
||||
Options:
|
||||
-q, --quiet Do not print cargo log messages
|
||||
-p, --package [<SPEC>] Package(s) to check
|
||||
--workspace Check all packages in the workspace
|
||||
--exclude <SPEC> Exclude packages from the check
|
||||
--all Alias for --workspace (deprecated)
|
||||
-j, --jobs <N> Number of parallel jobs, defaults to # of CPUs.
|
||||
--keep-going Do not abort the build as soon as there is an error (unstable)
|
||||
--lib Check only this package's library
|
||||
--bins Check all binaries
|
||||
--bin [<NAME>] Check only the specified binary
|
||||
--examples Check all examples
|
||||
--example [<NAME>] Check only the specified example
|
||||
--tests Check all tests
|
||||
--test [<NAME>] Check only the specified test target
|
||||
--benches Check all benches
|
||||
--bench [<NAME>] Check only the specified bench target
|
||||
--all-targets Check all targets
|
||||
-r, --release Check artifacts in release mode, with optimizations
|
||||
--profile <PROFILE-NAME> Check artifacts with the specified profile
|
||||
-F, --features <FEATURES> Space or comma separated list of features to activate
|
||||
--all-features Activate all available features
|
||||
--no-default-features Do not activate the `default` feature
|
||||
--target <TRIPLE> Check for the target triple
|
||||
--target-dir <DIRECTORY> Directory for all generated artifacts
|
||||
--manifest-path <PATH> Path to Cargo.toml
|
||||
--ignore-rust-version Ignore `rust-version` specification in packages
|
||||
--message-format <FMT> Error format
|
||||
--unit-graph Output build graph in JSON (unstable)
|
||||
--future-incompat-report Outputs a future incompatibility report at the end of the build
|
||||
--timings[=<FMTS>] Timing output formats (unstable) (comma separated): html, json
|
||||
-h, --help Print help
|
||||
-v, --verbose... Use verbose output (-vv very verbose/build.rs output)
|
||||
--color <WHEN> Coloring: auto, always, never
|
||||
--frozen Require Cargo.lock and cache are up to date
|
||||
--locked Require Cargo.lock is up to date
|
||||
--offline Run without accessing the network
|
||||
--config <KEY=VALUE> Override a configuration value
|
||||
-Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for
|
||||
details
|
||||
|
||||
Run `cargo help check` for more detailed information.
|
1
tests/testsuite/cargo_check/mod.rs
Normal file
1
tests/testsuite/cargo_check/mod.rs
Normal file
|
@ -0,0 +1 @@
|
|||
mod help;
|
13
tests/testsuite/cargo_clean/help/mod.rs
Normal file
13
tests/testsuite/cargo_clean/help/mod.rs
Normal file
|
@ -0,0 +1,13 @@
|
|||
use cargo_test_support::curr_dir;
|
||||
use cargo_test_support::prelude::*;
|
||||
|
||||
#[cargo_test]
|
||||
fn case() {
|
||||
snapbox::cmd::Command::cargo_ui()
|
||||
.arg("clean")
|
||||
.arg("--help")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout_matches_path(curr_dir!().join("stdout.log"))
|
||||
.stderr_matches_path(curr_dir!().join("stderr.log"));
|
||||
}
|
0
tests/testsuite/cargo_clean/help/stderr.log
Normal file
0
tests/testsuite/cargo_clean/help/stderr.log
Normal file
24
tests/testsuite/cargo_clean/help/stdout.log
Normal file
24
tests/testsuite/cargo_clean/help/stdout.log
Normal file
|
@ -0,0 +1,24 @@
|
|||
Remove artifacts that cargo has generated in the past
|
||||
|
||||
Usage: cargo[EXE] clean [OPTIONS]
|
||||
|
||||
Options:
|
||||
-q, --quiet Do not print cargo log messages
|
||||
-p, --package [<SPEC>] Package to clean artifacts for
|
||||
--manifest-path <PATH> Path to Cargo.toml
|
||||
--target <TRIPLE> Target triple to clean output for
|
||||
--target-dir <DIRECTORY> Directory for all generated artifacts
|
||||
-r, --release Whether or not to clean release artifacts
|
||||
--profile <PROFILE-NAME> Clean artifacts of the specified profile
|
||||
--doc Whether or not to clean just the documentation directory
|
||||
-h, --help Print help
|
||||
-v, --verbose... Use verbose output (-vv very verbose/build.rs output)
|
||||
--color <WHEN> Coloring: auto, always, never
|
||||
--frozen Require Cargo.lock and cache are up to date
|
||||
--locked Require Cargo.lock is up to date
|
||||
--offline Run without accessing the network
|
||||
--config <KEY=VALUE> Override a configuration value
|
||||
-Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for
|
||||
details
|
||||
|
||||
Run `cargo help clean` for more detailed information.
|
1
tests/testsuite/cargo_clean/mod.rs
Normal file
1
tests/testsuite/cargo_clean/mod.rs
Normal file
|
@ -0,0 +1 @@
|
|||
mod help;
|
13
tests/testsuite/cargo_config/help/mod.rs
Normal file
13
tests/testsuite/cargo_config/help/mod.rs
Normal file
|
@ -0,0 +1,13 @@
|
|||
use cargo_test_support::curr_dir;
|
||||
use cargo_test_support::prelude::*;
|
||||
|
||||
#[cargo_test]
|
||||
fn case() {
|
||||
snapbox::cmd::Command::cargo_ui()
|
||||
.arg("config")
|
||||
.arg("--help")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout_matches_path(curr_dir!().join("stdout.log"))
|
||||
.stderr_matches_path(curr_dir!().join("stderr.log"));
|
||||
}
|
0
tests/testsuite/cargo_config/help/stderr.log
Normal file
0
tests/testsuite/cargo_config/help/stderr.log
Normal file
16
tests/testsuite/cargo_config/help/stdout.log
Normal file
16
tests/testsuite/cargo_config/help/stdout.log
Normal file
|
@ -0,0 +1,16 @@
|
|||
Inspect configuration values
|
||||
|
||||
Usage: cargo[EXE] config [OPTIONS] <COMMAND>
|
||||
|
||||
Commands:
|
||||
get
|
||||
|
||||
Options:
|
||||
-h, --help Print help
|
||||
-v, --verbose... Use verbose output (-vv very verbose/build.rs output)
|
||||
--color <WHEN> Coloring: auto, always, never
|
||||
--frozen Require Cargo.lock and cache are up to date
|
||||
--locked Require Cargo.lock is up to date
|
||||
--offline Run without accessing the network
|
||||
--config <KEY=VALUE> Override a configuration value
|
||||
-Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
|
|
@ -5,6 +5,8 @@ use cargo_test_support::paths;
|
|||
use std::fs;
|
||||
use std::path::PathBuf;
|
||||
|
||||
mod help;
|
||||
|
||||
fn cargo_process(s: &str) -> cargo_test_support::Execs {
|
||||
let mut p = cargo_test_support::cargo_process(s);
|
||||
// Clear out some of the environment added by the default cargo_process so
|
||||
|
|
13
tests/testsuite/cargo_doc/help/mod.rs
Normal file
13
tests/testsuite/cargo_doc/help/mod.rs
Normal file
|
@ -0,0 +1,13 @@
|
|||
use cargo_test_support::curr_dir;
|
||||
use cargo_test_support::prelude::*;
|
||||
|
||||
#[cargo_test]
|
||||
fn case() {
|
||||
snapbox::cmd::Command::cargo_ui()
|
||||
.arg("doc")
|
||||
.arg("--help")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout_matches_path(curr_dir!().join("stdout.log"))
|
||||
.stderr_matches_path(curr_dir!().join("stderr.log"));
|
||||
}
|
0
tests/testsuite/cargo_doc/help/stderr.log
Normal file
0
tests/testsuite/cargo_doc/help/stderr.log
Normal file
43
tests/testsuite/cargo_doc/help/stdout.log
Normal file
43
tests/testsuite/cargo_doc/help/stdout.log
Normal file
|
@ -0,0 +1,43 @@
|
|||
Build a package's documentation
|
||||
|
||||
Usage: cargo[EXE] doc [OPTIONS]
|
||||
|
||||
Options:
|
||||
-q, --quiet Do not print cargo log messages
|
||||
--open Opens the docs in a browser after the operation
|
||||
-p, --package [<SPEC>] Package to document
|
||||
--workspace Document all packages in the workspace
|
||||
--exclude <SPEC> Exclude packages from the build
|
||||
--all Alias for --workspace (deprecated)
|
||||
--no-deps Don't build documentation for dependencies
|
||||
--document-private-items Document private items
|
||||
-j, --jobs <N> Number of parallel jobs, defaults to # of CPUs.
|
||||
--keep-going Do not abort the build as soon as there is an error (unstable)
|
||||
--lib Document only this package's library
|
||||
--bins Document all binaries
|
||||
--bin [<NAME>] Document only the specified binary
|
||||
--examples Document all examples
|
||||
--example [<NAME>] Document only the specified example
|
||||
-r, --release Build artifacts in release mode, with optimizations
|
||||
--profile <PROFILE-NAME> Build artifacts with the specified profile
|
||||
-F, --features <FEATURES> Space or comma separated list of features to activate
|
||||
--all-features Activate all available features
|
||||
--no-default-features Do not activate the `default` feature
|
||||
--target <TRIPLE> Build for the target triple
|
||||
--target-dir <DIRECTORY> Directory for all generated artifacts
|
||||
--manifest-path <PATH> Path to Cargo.toml
|
||||
--message-format <FMT> Error format
|
||||
--ignore-rust-version Ignore `rust-version` specification in packages
|
||||
--unit-graph Output build graph in JSON (unstable)
|
||||
--timings[=<FMTS>] Timing output formats (unstable) (comma separated): html, json
|
||||
-h, --help Print help
|
||||
-v, --verbose... Use verbose output (-vv very verbose/build.rs output)
|
||||
--color <WHEN> Coloring: auto, always, never
|
||||
--frozen Require Cargo.lock and cache are up to date
|
||||
--locked Require Cargo.lock is up to date
|
||||
--offline Run without accessing the network
|
||||
--config <KEY=VALUE> Override a configuration value
|
||||
-Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for
|
||||
details
|
||||
|
||||
Run `cargo help doc` for more detailed information.
|
1
tests/testsuite/cargo_doc/mod.rs
Normal file
1
tests/testsuite/cargo_doc/mod.rs
Normal file
|
@ -0,0 +1 @@
|
|||
mod help;
|
13
tests/testsuite/cargo_fetch/help/mod.rs
Normal file
13
tests/testsuite/cargo_fetch/help/mod.rs
Normal file
|
@ -0,0 +1,13 @@
|
|||
use cargo_test_support::curr_dir;
|
||||
use cargo_test_support::prelude::*;
|
||||
|
||||
#[cargo_test]
|
||||
fn case() {
|
||||
snapbox::cmd::Command::cargo_ui()
|
||||
.arg("fetch")
|
||||
.arg("--help")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout_matches_path(curr_dir!().join("stdout.log"))
|
||||
.stderr_matches_path(curr_dir!().join("stderr.log"));
|
||||
}
|
0
tests/testsuite/cargo_fetch/help/stderr.log
Normal file
0
tests/testsuite/cargo_fetch/help/stderr.log
Normal file
19
tests/testsuite/cargo_fetch/help/stdout.log
Normal file
19
tests/testsuite/cargo_fetch/help/stdout.log
Normal file
|
@ -0,0 +1,19 @@
|
|||
Fetch dependencies of a package from the network
|
||||
|
||||
Usage: cargo[EXE] fetch [OPTIONS]
|
||||
|
||||
Options:
|
||||
-q, --quiet Do not print cargo log messages
|
||||
--manifest-path <PATH> Path to Cargo.toml
|
||||
--target <TRIPLE> Fetch dependencies for the target triple
|
||||
-h, --help Print help
|
||||
-v, --verbose... Use verbose output (-vv very verbose/build.rs output)
|
||||
--color <WHEN> Coloring: auto, always, never
|
||||
--frozen Require Cargo.lock and cache are up to date
|
||||
--locked Require Cargo.lock is up to date
|
||||
--offline Run without accessing the network
|
||||
--config <KEY=VALUE> Override a configuration value
|
||||
-Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for
|
||||
details
|
||||
|
||||
Run `cargo help fetch` for more detailed information.
|
1
tests/testsuite/cargo_fetch/mod.rs
Normal file
1
tests/testsuite/cargo_fetch/mod.rs
Normal file
|
@ -0,0 +1 @@
|
|||
mod help;
|
13
tests/testsuite/cargo_fix/help/mod.rs
Normal file
13
tests/testsuite/cargo_fix/help/mod.rs
Normal file
|
@ -0,0 +1,13 @@
|
|||
use cargo_test_support::curr_dir;
|
||||
use cargo_test_support::prelude::*;
|
||||
|
||||
#[cargo_test]
|
||||
fn case() {
|
||||
snapbox::cmd::Command::cargo_ui()
|
||||
.arg("fix")
|
||||
.arg("--help")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout_matches_path(curr_dir!().join("stdout.log"))
|
||||
.stderr_matches_path(curr_dir!().join("stderr.log"));
|
||||
}
|
0
tests/testsuite/cargo_fix/help/stderr.log
Normal file
0
tests/testsuite/cargo_fix/help/stderr.log
Normal file
50
tests/testsuite/cargo_fix/help/stdout.log
Normal file
50
tests/testsuite/cargo_fix/help/stdout.log
Normal file
|
@ -0,0 +1,50 @@
|
|||
Automatically fix lint warnings reported by rustc
|
||||
|
||||
Usage: cargo[EXE] fix [OPTIONS]
|
||||
|
||||
Options:
|
||||
-q, --quiet Do not print cargo log messages
|
||||
-p, --package [<SPEC>] Package(s) to fix
|
||||
--workspace Fix all packages in the workspace
|
||||
--exclude <SPEC> Exclude packages from the fixes
|
||||
--all Alias for --workspace (deprecated)
|
||||
-j, --jobs <N> Number of parallel jobs, defaults to # of CPUs.
|
||||
--keep-going Do not abort the build as soon as there is an error (unstable)
|
||||
--lib Fix only this package's library
|
||||
--bins Fix all binaries
|
||||
--bin [<NAME>] Fix only the specified binary
|
||||
--examples Fix all examples
|
||||
--example [<NAME>] Fix only the specified example
|
||||
--tests Fix all tests
|
||||
--test [<NAME>] Fix only the specified test target
|
||||
--benches Fix all benches
|
||||
--bench [<NAME>] Fix only the specified bench target
|
||||
--all-targets Fix all targets (default)
|
||||
-r, --release Fix artifacts in release mode, with optimizations
|
||||
--profile <PROFILE-NAME> Build artifacts with the specified profile
|
||||
-F, --features <FEATURES> Space or comma separated list of features to activate
|
||||
--all-features Activate all available features
|
||||
--no-default-features Do not activate the `default` feature
|
||||
--target <TRIPLE> Fix for the target triple
|
||||
--target-dir <DIRECTORY> Directory for all generated artifacts
|
||||
--manifest-path <PATH> Path to Cargo.toml
|
||||
--message-format <FMT> Error format
|
||||
--broken-code Fix code even if it already has compiler errors
|
||||
--edition Fix in preparation for the next edition
|
||||
--edition-idioms Fix warnings to migrate to the idioms of an edition
|
||||
--allow-no-vcs Fix code even if a VCS was not detected
|
||||
--allow-dirty Fix code even if the working directory is dirty
|
||||
--allow-staged Fix code even if the working directory has staged changes
|
||||
--ignore-rust-version Ignore `rust-version` specification in packages
|
||||
--timings[=<FMTS>] Timing output formats (unstable) (comma separated): html, json
|
||||
-h, --help Print help
|
||||
-v, --verbose... Use verbose output (-vv very verbose/build.rs output)
|
||||
--color <WHEN> Coloring: auto, always, never
|
||||
--frozen Require Cargo.lock and cache are up to date
|
||||
--locked Require Cargo.lock is up to date
|
||||
--offline Run without accessing the network
|
||||
--config <KEY=VALUE> Override a configuration value
|
||||
-Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for
|
||||
details
|
||||
|
||||
Run `cargo help fix` for more detailed information.
|
1
tests/testsuite/cargo_fix/mod.rs
Normal file
1
tests/testsuite/cargo_fix/mod.rs
Normal file
|
@ -0,0 +1 @@
|
|||
mod help;
|
13
tests/testsuite/cargo_generate_lockfile/help/mod.rs
Normal file
13
tests/testsuite/cargo_generate_lockfile/help/mod.rs
Normal file
|
@ -0,0 +1,13 @@
|
|||
use cargo_test_support::curr_dir;
|
||||
use cargo_test_support::prelude::*;
|
||||
|
||||
#[cargo_test]
|
||||
fn case() {
|
||||
snapbox::cmd::Command::cargo_ui()
|
||||
.arg("generate-lockfile")
|
||||
.arg("--help")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout_matches_path(curr_dir!().join("stdout.log"))
|
||||
.stderr_matches_path(curr_dir!().join("stderr.log"));
|
||||
}
|
18
tests/testsuite/cargo_generate_lockfile/help/stdout.log
Normal file
18
tests/testsuite/cargo_generate_lockfile/help/stdout.log
Normal file
|
@ -0,0 +1,18 @@
|
|||
Generate the lockfile for a package
|
||||
|
||||
Usage: cargo[EXE] generate-lockfile [OPTIONS]
|
||||
|
||||
Options:
|
||||
-q, --quiet Do not print cargo log messages
|
||||
--manifest-path <PATH> Path to Cargo.toml
|
||||
-h, --help Print help
|
||||
-v, --verbose... Use verbose output (-vv very verbose/build.rs output)
|
||||
--color <WHEN> Coloring: auto, always, never
|
||||
--frozen Require Cargo.lock and cache are up to date
|
||||
--locked Require Cargo.lock is up to date
|
||||
--offline Run without accessing the network
|
||||
--config <KEY=VALUE> Override a configuration value
|
||||
-Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for
|
||||
details
|
||||
|
||||
Run `cargo help generate-lockfile` for more detailed information.
|
1
tests/testsuite/cargo_generate_lockfile/mod.rs
Normal file
1
tests/testsuite/cargo_generate_lockfile/mod.rs
Normal file
|
@ -0,0 +1 @@
|
|||
mod help;
|
13
tests/testsuite/cargo_git_checkout/help/mod.rs
Normal file
13
tests/testsuite/cargo_git_checkout/help/mod.rs
Normal file
|
@ -0,0 +1,13 @@
|
|||
use cargo_test_support::curr_dir;
|
||||
use cargo_test_support::prelude::*;
|
||||
|
||||
#[cargo_test]
|
||||
fn case() {
|
||||
snapbox::cmd::Command::cargo_ui()
|
||||
.arg("git-checkout")
|
||||
.arg("--help")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout_matches_path(curr_dir!().join("stdout.log"))
|
||||
.stderr_matches_path(curr_dir!().join("stderr.log"));
|
||||
}
|
0
tests/testsuite/cargo_git_checkout/help/stderr.log
Normal file
0
tests/testsuite/cargo_git_checkout/help/stderr.log
Normal file
1
tests/testsuite/cargo_git_checkout/help/stdout.log
Normal file
1
tests/testsuite/cargo_git_checkout/help/stdout.log
Normal file
|
@ -0,0 +1 @@
|
|||
The `git-checkout` command has been removed.
|
1
tests/testsuite/cargo_git_checkout/mod.rs
Normal file
1
tests/testsuite/cargo_git_checkout/mod.rs
Normal file
|
@ -0,0 +1 @@
|
|||
mod help;
|
13
tests/testsuite/cargo_help/help/mod.rs
Normal file
13
tests/testsuite/cargo_help/help/mod.rs
Normal file
|
@ -0,0 +1,13 @@
|
|||
use cargo_test_support::curr_dir;
|
||||
use cargo_test_support::prelude::*;
|
||||
|
||||
#[cargo_test]
|
||||
fn case() {
|
||||
snapbox::cmd::Command::cargo_ui()
|
||||
.arg("help")
|
||||
.arg("--help")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout_matches_path(curr_dir!().join("stdout.log"))
|
||||
.stderr_matches_path(curr_dir!().join("stderr.log"));
|
||||
}
|
0
tests/testsuite/cargo_help/help/stderr.log
Normal file
0
tests/testsuite/cargo_help/help/stderr.log
Normal file
16
tests/testsuite/cargo_help/help/stdout.log
Normal file
16
tests/testsuite/cargo_help/help/stdout.log
Normal file
|
@ -0,0 +1,16 @@
|
|||
Displays help for a cargo subcommand
|
||||
|
||||
Usage: cargo[EXE] help [OPTIONS] [COMMAND]
|
||||
|
||||
Arguments:
|
||||
[COMMAND]
|
||||
|
||||
Options:
|
||||
-h, --help Print help
|
||||
-v, --verbose... Use verbose output (-vv very verbose/build.rs output)
|
||||
--color <WHEN> Coloring: auto, always, never
|
||||
--frozen Require Cargo.lock and cache are up to date
|
||||
--locked Require Cargo.lock is up to date
|
||||
--offline Run without accessing the network
|
||||
--config <KEY=VALUE> Override a configuration value
|
||||
-Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
|
1
tests/testsuite/cargo_help/mod.rs
Normal file
1
tests/testsuite/cargo_help/mod.rs
Normal file
|
@ -0,0 +1 @@
|
|||
mod help;
|
13
tests/testsuite/cargo_init/help/mod.rs
Normal file
13
tests/testsuite/cargo_init/help/mod.rs
Normal file
|
@ -0,0 +1,13 @@
|
|||
use cargo_test_support::curr_dir;
|
||||
use cargo_test_support::prelude::*;
|
||||
|
||||
#[cargo_test]
|
||||
fn case() {
|
||||
snapbox::cmd::Command::cargo_ui()
|
||||
.arg("init")
|
||||
.arg("--help")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout_matches_path(curr_dir!().join("stdout.log"))
|
||||
.stderr_matches_path(curr_dir!().join("stderr.log"));
|
||||
}
|
0
tests/testsuite/cargo_init/help/stderr.log
Normal file
0
tests/testsuite/cargo_init/help/stderr.log
Normal file
29
tests/testsuite/cargo_init/help/stdout.log
Normal file
29
tests/testsuite/cargo_init/help/stdout.log
Normal file
|
@ -0,0 +1,29 @@
|
|||
Create a new cargo package in an existing directory
|
||||
|
||||
Usage: cargo[EXE] init [OPTIONS] [path]
|
||||
|
||||
Arguments:
|
||||
[path] [default: .]
|
||||
|
||||
Options:
|
||||
-q, --quiet Do not print cargo log messages
|
||||
--registry <REGISTRY> Registry to use
|
||||
--vcs <VCS> Initialize a new repository for the given version control system (git,
|
||||
hg, pijul, or fossil) or do not initialize any version control at all
|
||||
(none), overriding a global configuration. [possible values: git, hg,
|
||||
pijul, fossil, none]
|
||||
--bin Use a binary (application) template [default]
|
||||
--lib Use a library template
|
||||
--edition <YEAR> Edition to set for the crate generated [possible values: 2015, 2018,
|
||||
2021]
|
||||
--name <NAME> Set the resulting package name, defaults to the directory name
|
||||
-h, --help Print help
|
||||
-v, --verbose... Use verbose output (-vv very verbose/build.rs output)
|
||||
--color <WHEN> Coloring: auto, always, never
|
||||
--frozen Require Cargo.lock and cache are up to date
|
||||
--locked Require Cargo.lock is up to date
|
||||
--offline Run without accessing the network
|
||||
--config <KEY=VALUE> Override a configuration value
|
||||
-Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
|
||||
|
||||
Run `cargo help init` for more detailed information.
|
|
@ -18,6 +18,7 @@ mod formats_source;
|
|||
mod fossil_autodetect;
|
||||
mod git_autodetect;
|
||||
mod git_ignore_exists_no_conflicting_entries;
|
||||
mod help;
|
||||
mod ignores_failure_to_format_source;
|
||||
mod inferred_bin_with_git;
|
||||
mod inferred_lib_with_git;
|
||||
|
|
13
tests/testsuite/cargo_install/help/mod.rs
Normal file
13
tests/testsuite/cargo_install/help/mod.rs
Normal file
|
@ -0,0 +1,13 @@
|
|||
use cargo_test_support::curr_dir;
|
||||
use cargo_test_support::prelude::*;
|
||||
|
||||
#[cargo_test]
|
||||
fn case() {
|
||||
snapbox::cmd::Command::cargo_ui()
|
||||
.arg("install")
|
||||
.arg("--help")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout_matches_path(curr_dir!().join("stdout.log"))
|
||||
.stderr_matches_path(curr_dir!().join("stderr.log"));
|
||||
}
|
0
tests/testsuite/cargo_install/help/stderr.log
Normal file
0
tests/testsuite/cargo_install/help/stderr.log
Normal file
48
tests/testsuite/cargo_install/help/stdout.log
Normal file
48
tests/testsuite/cargo_install/help/stdout.log
Normal file
|
@ -0,0 +1,48 @@
|
|||
Install a Rust binary. Default location is $HOME/.cargo/bin
|
||||
|
||||
Usage: cargo[EXE] install [OPTIONS] [crate]...
|
||||
|
||||
Arguments:
|
||||
[crate]...
|
||||
|
||||
Options:
|
||||
-q, --quiet Do not print cargo log messages
|
||||
--version <VERSION> Specify a version to install
|
||||
--git <URL> Git URL to install the specified crate from
|
||||
--branch <BRANCH> Branch to use when installing from git
|
||||
--tag <TAG> Tag to use when installing from git
|
||||
--rev <SHA> Specific commit to use when installing from git
|
||||
--path <PATH> Filesystem path to local crate to install
|
||||
--list list all installed packages and their versions
|
||||
-j, --jobs <N> Number of parallel jobs, defaults to # of CPUs.
|
||||
--keep-going Do not abort the build as soon as there is an error (unstable)
|
||||
-f, --force Force overwriting existing crates or binaries
|
||||
--no-track Do not save tracking information
|
||||
-F, --features <FEATURES> Space or comma separated list of features to activate
|
||||
--all-features Activate all available features
|
||||
--no-default-features Do not activate the `default` feature
|
||||
--profile <PROFILE-NAME> Install artifacts with the specified profile
|
||||
--debug Build in debug mode (with the 'dev' profile) instead of release mode
|
||||
--bin [<NAME>] Install only the specified binary
|
||||
--bins Install all binaries
|
||||
--example [<NAME>] Install only the specified example
|
||||
--examples Install all examples
|
||||
--target <TRIPLE> Build for the target triple
|
||||
--target-dir <DIRECTORY> Directory for all generated artifacts
|
||||
--root <DIR> Directory to install packages into
|
||||
--index <INDEX> Registry index to install from
|
||||
--registry <REGISTRY> Registry to use
|
||||
--ignore-rust-version Ignore `rust-version` specification in packages
|
||||
--message-format <FMT> Error format
|
||||
--timings[=<FMTS>] Timing output formats (unstable) (comma separated): html, json
|
||||
-h, --help Print help
|
||||
-v, --verbose... Use verbose output (-vv very verbose/build.rs output)
|
||||
--color <WHEN> Coloring: auto, always, never
|
||||
--frozen Require Cargo.lock and cache are up to date
|
||||
--locked Require Cargo.lock is up to date
|
||||
--offline Run without accessing the network
|
||||
--config <KEY=VALUE> Override a configuration value
|
||||
-Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for
|
||||
details
|
||||
|
||||
Run `cargo help install` for more detailed information.
|
1
tests/testsuite/cargo_install/mod.rs
Normal file
1
tests/testsuite/cargo_install/mod.rs
Normal file
|
@ -0,0 +1 @@
|
|||
mod help;
|
13
tests/testsuite/cargo_locate_project/help/mod.rs
Normal file
13
tests/testsuite/cargo_locate_project/help/mod.rs
Normal file
|
@ -0,0 +1,13 @@
|
|||
use cargo_test_support::curr_dir;
|
||||
use cargo_test_support::prelude::*;
|
||||
|
||||
#[cargo_test]
|
||||
fn case() {
|
||||
snapbox::cmd::Command::cargo_ui()
|
||||
.arg("locate-project")
|
||||
.arg("--help")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout_matches_path(curr_dir!().join("stdout.log"))
|
||||
.stderr_matches_path(curr_dir!().join("stderr.log"));
|
||||
}
|
20
tests/testsuite/cargo_locate_project/help/stdout.log
Normal file
20
tests/testsuite/cargo_locate_project/help/stdout.log
Normal file
|
@ -0,0 +1,20 @@
|
|||
Print a JSON representation of a Cargo.toml file's location
|
||||
|
||||
Usage: cargo[EXE] locate-project [OPTIONS]
|
||||
|
||||
Options:
|
||||
-q, --quiet Do not print cargo log messages
|
||||
--manifest-path <PATH> Path to Cargo.toml
|
||||
--message-format <FMT> Output representation [possible values: json, plain]
|
||||
--workspace Locate Cargo.toml of the workspace root
|
||||
-h, --help Print help
|
||||
-v, --verbose... Use verbose output (-vv very verbose/build.rs output)
|
||||
--color <WHEN> Coloring: auto, always, never
|
||||
--frozen Require Cargo.lock and cache are up to date
|
||||
--locked Require Cargo.lock is up to date
|
||||
--offline Run without accessing the network
|
||||
--config <KEY=VALUE> Override a configuration value
|
||||
-Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for
|
||||
details
|
||||
|
||||
Run `cargo help locate-project` for more detailed information.
|
1
tests/testsuite/cargo_locate_project/mod.rs
Normal file
1
tests/testsuite/cargo_locate_project/mod.rs
Normal file
|
@ -0,0 +1 @@
|
|||
mod help;
|
13
tests/testsuite/cargo_login/help/mod.rs
Normal file
13
tests/testsuite/cargo_login/help/mod.rs
Normal file
|
@ -0,0 +1,13 @@
|
|||
use cargo_test_support::curr_dir;
|
||||
use cargo_test_support::prelude::*;
|
||||
|
||||
#[cargo_test]
|
||||
fn case() {
|
||||
snapbox::cmd::Command::cargo_ui()
|
||||
.arg("login")
|
||||
.arg("--help")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout_matches_path(curr_dir!().join("stdout.log"))
|
||||
.stderr_matches_path(curr_dir!().join("stderr.log"));
|
||||
}
|
0
tests/testsuite/cargo_login/help/stderr.log
Normal file
0
tests/testsuite/cargo_login/help/stderr.log
Normal file
20
tests/testsuite/cargo_login/help/stdout.log
Normal file
20
tests/testsuite/cargo_login/help/stdout.log
Normal file
|
@ -0,0 +1,20 @@
|
|||
Log in to a registry.
|
||||
|
||||
Usage: cargo[EXE] login [OPTIONS] [token]
|
||||
|
||||
Arguments:
|
||||
[token]
|
||||
|
||||
Options:
|
||||
-q, --quiet Do not print cargo log messages
|
||||
--registry <REGISTRY> Registry to use
|
||||
-h, --help Print help
|
||||
-v, --verbose... Use verbose output (-vv very verbose/build.rs output)
|
||||
--color <WHEN> Coloring: auto, always, never
|
||||
--frozen Require Cargo.lock and cache are up to date
|
||||
--locked Require Cargo.lock is up to date
|
||||
--offline Run without accessing the network
|
||||
--config <KEY=VALUE> Override a configuration value
|
||||
-Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
|
||||
|
||||
Run `cargo help login` for more detailed information.
|
1
tests/testsuite/cargo_login/mod.rs
Normal file
1
tests/testsuite/cargo_login/mod.rs
Normal file
|
@ -0,0 +1 @@
|
|||
mod help;
|
13
tests/testsuite/cargo_logout/help/mod.rs
Normal file
13
tests/testsuite/cargo_logout/help/mod.rs
Normal file
|
@ -0,0 +1,13 @@
|
|||
use cargo_test_support::curr_dir;
|
||||
use cargo_test_support::prelude::*;
|
||||
|
||||
#[cargo_test]
|
||||
fn case() {
|
||||
snapbox::cmd::Command::cargo_ui()
|
||||
.arg("logout")
|
||||
.arg("--help")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout_matches_path(curr_dir!().join("stdout.log"))
|
||||
.stderr_matches_path(curr_dir!().join("stderr.log"));
|
||||
}
|
0
tests/testsuite/cargo_logout/help/stderr.log
Normal file
0
tests/testsuite/cargo_logout/help/stderr.log
Normal file
17
tests/testsuite/cargo_logout/help/stdout.log
Normal file
17
tests/testsuite/cargo_logout/help/stdout.log
Normal file
|
@ -0,0 +1,17 @@
|
|||
Remove an API token from the registry locally
|
||||
|
||||
Usage: cargo[EXE] logout [OPTIONS]
|
||||
|
||||
Options:
|
||||
-q, --quiet Do not print cargo log messages
|
||||
--registry <REGISTRY> Registry to use
|
||||
-h, --help Print help
|
||||
-v, --verbose... Use verbose output (-vv very verbose/build.rs output)
|
||||
--color <WHEN> Coloring: auto, always, never
|
||||
--frozen Require Cargo.lock and cache are up to date
|
||||
--locked Require Cargo.lock is up to date
|
||||
--offline Run without accessing the network
|
||||
--config <KEY=VALUE> Override a configuration value
|
||||
-Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
|
||||
|
||||
Run `cargo help logout` for more detailed information.
|
1
tests/testsuite/cargo_logout/mod.rs
Normal file
1
tests/testsuite/cargo_logout/mod.rs
Normal file
|
@ -0,0 +1 @@
|
|||
mod help;
|
13
tests/testsuite/cargo_metadata/help/mod.rs
Normal file
13
tests/testsuite/cargo_metadata/help/mod.rs
Normal file
|
@ -0,0 +1,13 @@
|
|||
use cargo_test_support::curr_dir;
|
||||
use cargo_test_support::prelude::*;
|
||||
|
||||
#[cargo_test]
|
||||
fn case() {
|
||||
snapbox::cmd::Command::cargo_ui()
|
||||
.arg("metadata")
|
||||
.arg("--help")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout_matches_path(curr_dir!().join("stdout.log"))
|
||||
.stderr_matches_path(curr_dir!().join("stderr.log"));
|
||||
}
|
0
tests/testsuite/cargo_metadata/help/stderr.log
Normal file
0
tests/testsuite/cargo_metadata/help/stderr.log
Normal file
26
tests/testsuite/cargo_metadata/help/stdout.log
Normal file
26
tests/testsuite/cargo_metadata/help/stdout.log
Normal file
|
@ -0,0 +1,26 @@
|
|||
Output the resolved dependencies of a package, the concrete used versions including overrides, in
|
||||
machine-readable format
|
||||
|
||||
Usage: cargo[EXE] metadata [OPTIONS]
|
||||
|
||||
Options:
|
||||
-q, --quiet Do not print cargo log messages
|
||||
-F, --features <FEATURES> Space or comma separated list of features to activate
|
||||
--all-features Activate all available features
|
||||
--no-default-features Do not activate the `default` feature
|
||||
--filter-platform <TRIPLE> Only include resolve dependencies matching the given target-triple
|
||||
--no-deps Output information only about the workspace members and don't
|
||||
fetch dependencies
|
||||
--manifest-path <PATH> Path to Cargo.toml
|
||||
--format-version <VERSION> Format version [possible values: 1]
|
||||
-h, --help Print help
|
||||
-v, --verbose... Use verbose output (-vv very verbose/build.rs output)
|
||||
--color <WHEN> Coloring: auto, always, never
|
||||
--frozen Require Cargo.lock and cache are up to date
|
||||
--locked Require Cargo.lock is up to date
|
||||
--offline Run without accessing the network
|
||||
--config <KEY=VALUE> Override a configuration value
|
||||
-Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for
|
||||
details
|
||||
|
||||
Run `cargo help metadata` for more detailed information.
|
1
tests/testsuite/cargo_metadata/mod.rs
Normal file
1
tests/testsuite/cargo_metadata/mod.rs
Normal file
|
@ -0,0 +1 @@
|
|||
mod help;
|
13
tests/testsuite/cargo_new/help/mod.rs
Normal file
13
tests/testsuite/cargo_new/help/mod.rs
Normal file
|
@ -0,0 +1,13 @@
|
|||
use cargo_test_support::curr_dir;
|
||||
use cargo_test_support::prelude::*;
|
||||
|
||||
#[cargo_test]
|
||||
fn case() {
|
||||
snapbox::cmd::Command::cargo_ui()
|
||||
.arg("new")
|
||||
.arg("--help")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout_matches_path(curr_dir!().join("stdout.log"))
|
||||
.stderr_matches_path(curr_dir!().join("stderr.log"));
|
||||
}
|
0
tests/testsuite/cargo_new/help/stderr.log
Normal file
0
tests/testsuite/cargo_new/help/stderr.log
Normal file
29
tests/testsuite/cargo_new/help/stdout.log
Normal file
29
tests/testsuite/cargo_new/help/stdout.log
Normal file
|
@ -0,0 +1,29 @@
|
|||
Create a new cargo package at <path>
|
||||
|
||||
Usage: cargo[EXE] new [OPTIONS] <path>
|
||||
|
||||
Arguments:
|
||||
<path>
|
||||
|
||||
Options:
|
||||
-q, --quiet Do not print cargo log messages
|
||||
--registry <REGISTRY> Registry to use
|
||||
--vcs <VCS> Initialize a new repository for the given version control system (git,
|
||||
hg, pijul, or fossil) or do not initialize any version control at all
|
||||
(none), overriding a global configuration. [possible values: git, hg,
|
||||
pijul, fossil, none]
|
||||
--bin Use a binary (application) template [default]
|
||||
--lib Use a library template
|
||||
--edition <YEAR> Edition to set for the crate generated [possible values: 2015, 2018,
|
||||
2021]
|
||||
--name <NAME> Set the resulting package name, defaults to the directory name
|
||||
-h, --help Print help
|
||||
-v, --verbose... Use verbose output (-vv very verbose/build.rs output)
|
||||
--color <WHEN> Coloring: auto, always, never
|
||||
--frozen Require Cargo.lock and cache are up to date
|
||||
--locked Require Cargo.lock is up to date
|
||||
--offline Run without accessing the network
|
||||
--config <KEY=VALUE> Override a configuration value
|
||||
-Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
|
||||
|
||||
Run `cargo help new` for more detailed information.
|
|
@ -1,3 +1,4 @@
|
|||
mod help;
|
||||
mod inherit_workspace_lints;
|
||||
mod inherit_workspace_package_table;
|
||||
mod inherit_workspace_package_table_with_edition;
|
||||
|
|
13
tests/testsuite/cargo_owner/help/mod.rs
Normal file
13
tests/testsuite/cargo_owner/help/mod.rs
Normal file
|
@ -0,0 +1,13 @@
|
|||
use cargo_test_support::curr_dir;
|
||||
use cargo_test_support::prelude::*;
|
||||
|
||||
#[cargo_test]
|
||||
fn case() {
|
||||
snapbox::cmd::Command::cargo_ui()
|
||||
.arg("owner")
|
||||
.arg("--help")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout_matches_path(curr_dir!().join("stdout.log"))
|
||||
.stderr_matches_path(curr_dir!().join("stderr.log"));
|
||||
}
|
0
tests/testsuite/cargo_owner/help/stderr.log
Normal file
0
tests/testsuite/cargo_owner/help/stderr.log
Normal file
25
tests/testsuite/cargo_owner/help/stdout.log
Normal file
25
tests/testsuite/cargo_owner/help/stdout.log
Normal file
|
@ -0,0 +1,25 @@
|
|||
Manage the owners of a crate on the registry
|
||||
|
||||
Usage: cargo[EXE] owner [OPTIONS] [crate]
|
||||
|
||||
Arguments:
|
||||
[crate]
|
||||
|
||||
Options:
|
||||
-q, --quiet Do not print cargo log messages
|
||||
-a, --add <LOGIN> Name of a user or team to invite as an owner
|
||||
-r, --remove <LOGIN> Name of a user or team to remove as an owner
|
||||
-l, --list List owners of a crate
|
||||
--index <INDEX> Registry index to modify owners for
|
||||
--token <TOKEN> API token to use when authenticating
|
||||
--registry <REGISTRY> Registry to use
|
||||
-h, --help Print help
|
||||
-v, --verbose... Use verbose output (-vv very verbose/build.rs output)
|
||||
--color <WHEN> Coloring: auto, always, never
|
||||
--frozen Require Cargo.lock and cache are up to date
|
||||
--locked Require Cargo.lock is up to date
|
||||
--offline Run without accessing the network
|
||||
--config <KEY=VALUE> Override a configuration value
|
||||
-Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
|
||||
|
||||
Run `cargo help owner` for more detailed information.
|
1
tests/testsuite/cargo_owner/mod.rs
Normal file
1
tests/testsuite/cargo_owner/mod.rs
Normal file
|
@ -0,0 +1 @@
|
|||
mod help;
|
13
tests/testsuite/cargo_package/help/mod.rs
Normal file
13
tests/testsuite/cargo_package/help/mod.rs
Normal file
|
@ -0,0 +1,13 @@
|
|||
use cargo_test_support::curr_dir;
|
||||
use cargo_test_support::prelude::*;
|
||||
|
||||
#[cargo_test]
|
||||
fn case() {
|
||||
snapbox::cmd::Command::cargo_ui()
|
||||
.arg("package")
|
||||
.arg("--help")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout_matches_path(curr_dir!().join("stdout.log"))
|
||||
.stderr_matches_path(curr_dir!().join("stderr.log"));
|
||||
}
|
0
tests/testsuite/cargo_package/help/stderr.log
Normal file
0
tests/testsuite/cargo_package/help/stderr.log
Normal file
32
tests/testsuite/cargo_package/help/stdout.log
Normal file
32
tests/testsuite/cargo_package/help/stdout.log
Normal file
|
@ -0,0 +1,32 @@
|
|||
Assemble the local package into a distributable tarball
|
||||
|
||||
Usage: cargo[EXE] package [OPTIONS]
|
||||
|
||||
Options:
|
||||
-q, --quiet Do not print cargo log messages
|
||||
-l, --list Print files included in a package without making one
|
||||
--no-verify Don't verify the contents by building them
|
||||
--no-metadata Ignore warnings about a lack of human-usable metadata
|
||||
--allow-dirty Allow dirty working directories to be packaged
|
||||
--target <TRIPLE> Build for the target triple
|
||||
--target-dir <DIRECTORY> Directory for all generated artifacts
|
||||
-F, --features <FEATURES> Space or comma separated list of features to activate
|
||||
--all-features Activate all available features
|
||||
--no-default-features Do not activate the `default` feature
|
||||
-p, --package [<SPEC>] Package(s) to assemble
|
||||
--workspace Assemble all packages in the workspace
|
||||
--exclude <SPEC> Don't assemble specified packages
|
||||
--manifest-path <PATH> Path to Cargo.toml
|
||||
-j, --jobs <N> Number of parallel jobs, defaults to # of CPUs.
|
||||
--keep-going Do not abort the build as soon as there is an error (unstable)
|
||||
-h, --help Print help
|
||||
-v, --verbose... Use verbose output (-vv very verbose/build.rs output)
|
||||
--color <WHEN> Coloring: auto, always, never
|
||||
--frozen Require Cargo.lock and cache are up to date
|
||||
--locked Require Cargo.lock is up to date
|
||||
--offline Run without accessing the network
|
||||
--config <KEY=VALUE> Override a configuration value
|
||||
-Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for
|
||||
details
|
||||
|
||||
Run `cargo help package` for more detailed information.
|
1
tests/testsuite/cargo_package/mod.rs
Normal file
1
tests/testsuite/cargo_package/mod.rs
Normal file
|
@ -0,0 +1 @@
|
|||
mod help;
|
13
tests/testsuite/cargo_pkgid/help/mod.rs
Normal file
13
tests/testsuite/cargo_pkgid/help/mod.rs
Normal file
|
@ -0,0 +1,13 @@
|
|||
use cargo_test_support::curr_dir;
|
||||
use cargo_test_support::prelude::*;
|
||||
|
||||
#[cargo_test]
|
||||
fn case() {
|
||||
snapbox::cmd::Command::cargo_ui()
|
||||
.arg("pkgid")
|
||||
.arg("--help")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout_matches_path(curr_dir!().join("stdout.log"))
|
||||
.stderr_matches_path(curr_dir!().join("stderr.log"));
|
||||
}
|
0
tests/testsuite/cargo_pkgid/help/stderr.log
Normal file
0
tests/testsuite/cargo_pkgid/help/stderr.log
Normal file
22
tests/testsuite/cargo_pkgid/help/stdout.log
Normal file
22
tests/testsuite/cargo_pkgid/help/stdout.log
Normal file
|
@ -0,0 +1,22 @@
|
|||
Print a fully qualified package specification
|
||||
|
||||
Usage: cargo[EXE] pkgid [OPTIONS] [spec]
|
||||
|
||||
Arguments:
|
||||
[spec]
|
||||
|
||||
Options:
|
||||
-q, --quiet Do not print cargo log messages
|
||||
-p, --package [<SPEC>] Argument to get the package ID specifier for
|
||||
--manifest-path <PATH> Path to Cargo.toml
|
||||
-h, --help Print help
|
||||
-v, --verbose... Use verbose output (-vv very verbose/build.rs output)
|
||||
--color <WHEN> Coloring: auto, always, never
|
||||
--frozen Require Cargo.lock and cache are up to date
|
||||
--locked Require Cargo.lock is up to date
|
||||
--offline Run without accessing the network
|
||||
--config <KEY=VALUE> Override a configuration value
|
||||
-Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for
|
||||
details
|
||||
|
||||
Run `cargo help pkgid` for more detailed information.
|
1
tests/testsuite/cargo_pkgid/mod.rs
Normal file
1
tests/testsuite/cargo_pkgid/mod.rs
Normal file
|
@ -0,0 +1 @@
|
|||
mod help;
|
13
tests/testsuite/cargo_publish/help/mod.rs
Normal file
13
tests/testsuite/cargo_publish/help/mod.rs
Normal file
|
@ -0,0 +1,13 @@
|
|||
use cargo_test_support::curr_dir;
|
||||
use cargo_test_support::prelude::*;
|
||||
|
||||
#[cargo_test]
|
||||
fn case() {
|
||||
snapbox::cmd::Command::cargo_ui()
|
||||
.arg("publish")
|
||||
.arg("--help")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout_matches_path(curr_dir!().join("stdout.log"))
|
||||
.stderr_matches_path(curr_dir!().join("stderr.log"));
|
||||
}
|
0
tests/testsuite/cargo_publish/help/stderr.log
Normal file
0
tests/testsuite/cargo_publish/help/stderr.log
Normal file
32
tests/testsuite/cargo_publish/help/stdout.log
Normal file
32
tests/testsuite/cargo_publish/help/stdout.log
Normal file
|
@ -0,0 +1,32 @@
|
|||
Upload a package to the registry
|
||||
|
||||
Usage: cargo[EXE] publish [OPTIONS]
|
||||
|
||||
Options:
|
||||
-q, --quiet Do not print cargo log messages
|
||||
--index <INDEX> Registry index URL to upload the package to
|
||||
--token <TOKEN> Token to use when uploading
|
||||
--no-verify Don't verify the contents by building them
|
||||
--allow-dirty Allow dirty working directories to be packaged
|
||||
--target <TRIPLE> Build for the target triple
|
||||
--target-dir <DIRECTORY> Directory for all generated artifacts
|
||||
-p, --package [<SPEC>] Package to publish
|
||||
--manifest-path <PATH> Path to Cargo.toml
|
||||
-F, --features <FEATURES> Space or comma separated list of features to activate
|
||||
--all-features Activate all available features
|
||||
--no-default-features Do not activate the `default` feature
|
||||
-j, --jobs <N> Number of parallel jobs, defaults to # of CPUs.
|
||||
--keep-going Do not abort the build as soon as there is an error (unstable)
|
||||
--dry-run Perform all checks without uploading
|
||||
--registry <REGISTRY> Registry to publish to
|
||||
-h, --help Print help
|
||||
-v, --verbose... Use verbose output (-vv very verbose/build.rs output)
|
||||
--color <WHEN> Coloring: auto, always, never
|
||||
--frozen Require Cargo.lock and cache are up to date
|
||||
--locked Require Cargo.lock is up to date
|
||||
--offline Run without accessing the network
|
||||
--config <KEY=VALUE> Override a configuration value
|
||||
-Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for
|
||||
details
|
||||
|
||||
Run `cargo help publish` for more detailed information.
|
1
tests/testsuite/cargo_publish/mod.rs
Normal file
1
tests/testsuite/cargo_publish/mod.rs
Normal file
|
@ -0,0 +1 @@
|
|||
mod help;
|
13
tests/testsuite/cargo_read_manifest/help/mod.rs
Normal file
13
tests/testsuite/cargo_read_manifest/help/mod.rs
Normal file
|
@ -0,0 +1,13 @@
|
|||
use cargo_test_support::curr_dir;
|
||||
use cargo_test_support::prelude::*;
|
||||
|
||||
#[cargo_test]
|
||||
fn case() {
|
||||
snapbox::cmd::Command::cargo_ui()
|
||||
.arg("read-manifest")
|
||||
.arg("--help")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout_matches_path(curr_dir!().join("stdout.log"))
|
||||
.stderr_matches_path(curr_dir!().join("stderr.log"));
|
||||
}
|
0
tests/testsuite/cargo_read_manifest/help/stderr.log
Normal file
0
tests/testsuite/cargo_read_manifest/help/stderr.log
Normal file
18
tests/testsuite/cargo_read_manifest/help/stdout.log
Normal file
18
tests/testsuite/cargo_read_manifest/help/stdout.log
Normal file
|
@ -0,0 +1,18 @@
|
|||
Print a JSON representation of a Cargo.toml manifest.
|
||||
|
||||
Deprecated, use `cargo metadata --no-deps` instead.
|
||||
|
||||
Usage: cargo[EXE] read-manifest [OPTIONS]
|
||||
|
||||
Options:
|
||||
-q, --quiet Do not print cargo log messages
|
||||
--manifest-path <PATH> Path to Cargo.toml
|
||||
-h, --help Print help
|
||||
-v, --verbose... Use verbose output (-vv very verbose/build.rs output)
|
||||
--color <WHEN> Coloring: auto, always, never
|
||||
--frozen Require Cargo.lock and cache are up to date
|
||||
--locked Require Cargo.lock is up to date
|
||||
--offline Run without accessing the network
|
||||
--config <KEY=VALUE> Override a configuration value
|
||||
-Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for
|
||||
details
|
1
tests/testsuite/cargo_read_manifest/mod.rs
Normal file
1
tests/testsuite/cargo_read_manifest/mod.rs
Normal file
|
@ -0,0 +1 @@
|
|||
mod help;
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue