From d1b2d29528b7794b41e66fc2136e395a02f8529b Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 30 May 2024 05:59:35 +0200 Subject: Merging upstream version 1.73.0+dfsg1. Signed-off-by: Daniel Baumann --- .../cargo/tests/testsuite/cargo_add/help/mod.rs | 13 +++ .../tests/testsuite/cargo_add/help/stderr.log | 0 .../tests/testsuite/cargo_add/help/stdout.log | 124 +++++++++++++++++++++ src/tools/cargo/tests/testsuite/cargo_add/mod.rs | 1 + 4 files changed, 138 insertions(+) create mode 100644 src/tools/cargo/tests/testsuite/cargo_add/help/mod.rs create mode 100644 src/tools/cargo/tests/testsuite/cargo_add/help/stderr.log create mode 100644 src/tools/cargo/tests/testsuite/cargo_add/help/stdout.log (limited to 'src/tools/cargo/tests/testsuite/cargo_add') diff --git a/src/tools/cargo/tests/testsuite/cargo_add/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_add/help/mod.rs new file mode 100644 index 000000000..0962047f8 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_add/help/mod.rs @@ -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")); +} diff --git a/src/tools/cargo/tests/testsuite/cargo_add/help/stderr.log b/src/tools/cargo/tests/testsuite/cargo_add/help/stderr.log new file mode 100644 index 000000000..e69de29bb diff --git a/src/tools/cargo/tests/testsuite/cargo_add/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_add/help/stdout.log new file mode 100644 index 000000000..0daba1a94 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_add/help/stdout.log @@ -0,0 +1,124 @@ +Add dependencies to a Cargo.toml manifest file + +Usage: cargo add [OPTIONS] [@] ... + cargo add [OPTIONS] --path ... + cargo add [OPTIONS] --git ... + +Arguments: + [DEP_ID]... + Reference to a package to add as a dependency + + You can reference a package by: + - ``, like `cargo add serde` (latest version will be used) + - `@`, 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 + 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 + 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) + + --dry-run + Don't actually write the manifest + + -q, --quiet + Do not print cargo log messages + + -v, --verbose... + Use verbose output (-vv very verbose/build.rs output) + + --color + Coloring: auto, always, never + + --config + Override a configuration value + + -Z + Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + + -h, --help + Print help (see a summary with '-h') + +Manifest Options: + --manifest-path + Path to Cargo.toml + + --frozen + Require Cargo.lock and cache are up to date + + --locked + Require Cargo.lock is up to date + + --offline + Run without accessing the network + +Package Selection: + -p, --package [] + Package to modify + +Source: + --path + Filesystem path to local crate to add + + --git + Git repository location + + Without any other information, cargo will use latest commit on the main branch. + + --branch + Git branch to download the crate from + + --tag + Git tag to download the crate from + + --rev + Git reference to download the crate from + + This is the catch all, handling hashes to named references in remote repositories. + + --registry + 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 + Add as dependency to the given target platform + +Run `cargo help add` for more detailed information. diff --git a/src/tools/cargo/tests/testsuite/cargo_add/mod.rs b/src/tools/cargo/tests/testsuite/cargo_add/mod.rs index be7a1546b..de93afbc1 100644 --- a/src/tools/cargo/tests/testsuite/cargo_add/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_add/mod.rs @@ -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; -- cgit v1.2.3