Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: reflect to clap updates #11578

Merged
merged 1 commit into from
Jan 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ toml_edit = { version = "0.15.0", features = ["serde", "easy", "perf"] }
unicode-xid = "0.2.0"
url = "2.2.2"
walkdir = "2.2"
clap = "4.0.15"
clap = "4.1.1"
unicode-width = "0.1.5"
openssl = { version = '0.10.11', optional = true }
im-rc = "15.0.0"
Expand Down
4 changes: 2 additions & 2 deletions tests/testsuite/cargo_add/dev_build_conflict/stderr.log
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
error: The argument '--dev' cannot be used with '--build'
error: the argument '--dev' cannot be used with '--build'

Usage: cargo add [OPTIONS] <DEP>[@<VERSION>] ...
cargo add [OPTIONS] --path <PATH> ...
cargo add [OPTIONS] --git <URL> ...

For more information try '--help'
For more information, try '--help'.
6 changes: 3 additions & 3 deletions tests/testsuite/cargo_add/invalid_arg/stderr.log
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
error: Found argument '--flag' which wasn't expected, or isn't valid in this context
error: unexpected argument '--flag' found

If you tried to supply '--flag' as a value rather than a flag, use '-- --flag'
note: to pass '--flag' as a value, use '-- --flag'

Usage: cargo add [OPTIONS] <DEP>[@<VERSION>] ...
cargo add [OPTIONS] --path <PATH> ...
cargo add [OPTIONS] --git <URL> ...

For more information try '--help'
For more information, try '--help'.
4 changes: 2 additions & 2 deletions tests/testsuite/cargo_add/invalid_target_empty/stderr.log
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
error: The argument '--target <TARGET>' requires a value but none was supplied
error: a value is required for '--target <TARGET>' but none was supplied

For more information try '--help'
For more information, try '--help'.
4 changes: 2 additions & 2 deletions tests/testsuite/cargo_add/no_args/stderr.log
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error: The following required arguments were not provided:
error: the following required arguments were not provided:
<DEP_ID|--path <PATH>|--git <URI>>

Usage: cargo add [OPTIONS] <DEP>[@<VERSION>] ...
cargo add [OPTIONS] --path <PATH> ...
cargo add [OPTIONS] --git <URL> ...

For more information try '--help'
For more information, try '--help'.
6 changes: 3 additions & 3 deletions tests/testsuite/cargo_remove/invalid_arg/stderr.log
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
error: Found argument '--flag' which wasn't expected, or isn't valid in this context
error: unexpected argument '--flag' found

If you tried to supply '--flag' as a value rather than a flag, use '-- --flag'
note: to pass '--flag' as a value, use '-- --flag'

Usage: cargo[EXE] remove <DEP_ID>...

For more information try '--help'
For more information, try '--help'.
4 changes: 2 additions & 2 deletions tests/testsuite/cargo_remove/no_arg/stderr.log
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
error: The following required arguments were not provided:
error: the following required arguments were not provided:
<DEP_ID>...

Usage: cargo[EXE] remove <DEP_ID>...

For more information try '--help'
For more information, try '--help'.
6 changes: 3 additions & 3 deletions tests/testsuite/init/unknown_flags/stderr.log
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
error: Found argument '--flag' which wasn't expected, or isn't valid in this context
error: unexpected argument '--flag' found

If you tried to supply '--flag' as a value rather than a flag, use '-- --flag'
note: to pass '--flag' as a value, use '-- --flag'

Usage: cargo[EXE] init <path>

For more information try '--help'
For more information, try '--help'.
6 changes: 2 additions & 4 deletions tests/testsuite/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1446,7 +1446,7 @@ fn not_both_vers_and_version() {
.with_status(1)
.with_stderr_contains(
"\
error: The argument '--version <VERSION>' was provided more than once, but cannot be used multiple times
[ERROR] the argument '--version <VERSION>' cannot be used multiple times
",
)
.run();
Expand Down Expand Up @@ -1648,9 +1648,7 @@ fn install_empty_argument() {
cargo_process("install")
.arg("")
.with_status(1)
.with_stderr_contains(
"[ERROR] The argument '[crate]...' requires a value but none was supplied",
)
.with_stderr_contains("[ERROR] a value is required for '[crate]...' but none was supplied")
.run();
}

Expand Down
8 changes: 4 additions & 4 deletions tests/testsuite/login.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,26 +133,26 @@ fn bad_asymmetric_token_args() {
// These cases are kept brief as the implementation is covered by clap, so this is only smoke testing that we have clap configured correctly.
cargo_process("login --key-subject=foo tok")
.with_stderr_contains(
"[ERROR] The argument '--key-subject <SUBJECT>' cannot be used with '[token]'",
"error: the argument '--key-subject <SUBJECT>' cannot be used with '[token]'",
)
.with_status(1)
.run();

cargo_process("login --generate-keypair tok")
.with_stderr_contains(
"[ERROR] The argument '--generate-keypair' cannot be used with '[token]'",
"error: the argument '--generate-keypair' cannot be used with '[token]'",
)
.with_status(1)
.run();

cargo_process("login --secret-key tok")
.with_stderr_contains("[ERROR] The argument '--secret-key' cannot be used with '[token]'")
.with_stderr_contains("error: the argument '--secret-key' cannot be used with '[token]'")
.with_status(1)
.run();

cargo_process("login --generate-keypair --secret-key")
.with_stderr_contains(
"[ERROR] The argument '--generate-keypair' cannot be used with '--secret-key'",
"error: the argument '--generate-keypair' cannot be used with '--secret-key'",
)
.with_status(1)
.run();
Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1910,7 +1910,7 @@ fn cargo_metadata_bad_version() {
.with_status(1)
.with_stderr_contains(
"\
error: '2' isn't a valid value for '--format-version <VERSION>'
error: invalid value '2' for '--format-version <VERSION>'
[possible values: 1]
",
)
Expand Down
8 changes: 3 additions & 5 deletions tests/testsuite/new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ fn no_argument() {
.with_status(1)
.with_stderr_contains(
"\
error: The following required arguments were not provided:
error: the following required arguments were not provided:
<path>
",
)
Expand Down Expand Up @@ -321,9 +321,7 @@ fn subpackage_git_with_vcs_arg() {
fn unknown_flags() {
cargo_process("new foo --flag")
.with_status(1)
.with_stderr_contains(
"error: Found argument '--flag' which wasn't expected, or isn't valid in this context",
)
.with_stderr_contains("error: unexpected argument '--flag' found")
.run();
}

Expand Down Expand Up @@ -380,7 +378,7 @@ fn new_default_edition() {
#[cargo_test]
fn new_with_bad_edition() {
cargo_process("new --edition something_else foo")
.with_stderr_contains("error: 'something_else' isn't a valid value[..]")
.with_stderr_contains("error: invalid value 'something_else' for '--edition <YEAR>'")
.with_status(1)
.run();
}
Expand Down
7 changes: 5 additions & 2 deletions tests/testsuite/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,10 @@ fn run_bins() {
p.cargo("run --bins")
.with_status(1)
.with_stderr_contains(
"error: Found argument '--bins' which wasn't expected, or isn't valid in this context",
"\
error: unexpected argument '--bins' found

note: argument '--bin' exists",
)
.run();
}
Expand Down Expand Up @@ -1321,7 +1324,7 @@ fn run_multiple_packages() {
.arg("d2")
.with_status(1)
.with_stderr_contains(
"error: The argument '--package [<SPEC>]' was provided more than once, but cannot be used multiple times",
"error: the argument '--package [<SPEC>]' cannot be used multiple times",
)
.run();

Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ fn fail_with_multiple_packages() {
.with_status(1)
.with_stderr_contains(
"\
error: The argument '--package [<SPEC>]' was provided more than once, but cannot be used multiple times
error: the argument '--package [<SPEC>]' cannot be used multiple times
",
)
.run();
Expand Down
4 changes: 2 additions & 2 deletions tests/testsuite/vendor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,11 +436,11 @@ fn test_sync_argument() {

p.cargo("vendor --respect-source-config --manifest-path foo/Cargo.toml -s bar/Cargo.toml baz/Cargo.toml test_vendor")
.with_stderr("\
error: Found argument 'test_vendor' which wasn't expected, or isn't valid in this context
error: unexpected argument 'test_vendor' found

Usage: cargo[EXE] vendor [OPTIONS] [path]

For more information try '--help'",
For more information, try '--help'.",
)
.with_status(1)
.run();
Expand Down