Commit graph

26 commits

Author SHA1 Message Date
hi-rustin
12d7818192 Add features to the default Cargo.toml file
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-11-19 22:03:57 +08:00
Eric Huss
80ffb1de1c Fix --quiet being used with nested subcommands.
This fixes an issue where `--quiet` doesn't work with commands that have
subcommands. This is because `config_configure` only looks at the global
and top-level subcommand, and not deeper subcommands. The issue was that
`--quiet` was not defined as a global flag. This was changed in
https://github.com/rust-lang/cargo/pull/6358 in order to give a better
help message for `cargo test --quiet`. I don't remember if clap just
didn't support overriding at the time, or if we just didn't know how it
worked. Anyways, it seems to work to override it now, so I think it
should be fine to mark it as global.

This should bring in `--quiet` more in-line with how `--verbose` works.
This means that `--quiet` is now accepted with `cargo report`,
`cargo help`, and `cargo config`.

This also fixes `--quiet` with `cargo clean gc`.

This should also help with supporting `--quiet` with the new `cargo
owner` subcommands being added in
https://github.com/rust-lang/cargo/pull/11879.

Fixes #12957
2023-11-12 11:17:43 -08:00
hi-rustin
fb0bbe36f1 Search dep in other tables and update tests
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-11-07 09:33:44 +08:00
Ed Page
6281109e5b fix(remove): Carry comments across removes 2023-10-17 11:56:54 -05:00
Ed Page
5374e8aa70 fix(remove): Leave formatting to the user
Fixes #11743
2023-10-17 11:51:45 -05:00
Ed Page
b17a73df1d test(remove): Extend the formatting tested 2023-10-17 11:49:26 -05:00
Ed Page
253a944aca test(remove): Add a more extensive formatting test 2023-10-17 10:49:33 -05:00
David Calavera
8849d25218 Update rm help to be specific about the section.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2023-10-17 11:53:57 +02:00
Ed Page
033e06a1cc feat(cli): Add '-n' to dry-run
This came from #12638 and my many small frustrations from wanting to use
`-n` and not being able to.

We do not have any existing `-n` flags for this to be confused with.

I would wager that `-n` is such an entrenched short flag in build tools that it would
not make sense for us to use it with any other flag.

For a survey of where `-n` is used as a short, see
https://www.gnu.org/prep/standards/html_node/Option-Table.html#Option-Table
2023-09-12 13:42:00 -05:00
Ed Page
e46379a7f3 fix(remove): Include 'cargo help' suggestion in -h 2023-09-01 09:30:00 -05:00
hi-rustin
63ccc35642 Add skip gc glob profile test 2023-09-06 12:51:39 +08:00
bors
af431e1bb7 Auto merge of #12454 - alcolmenar:alcolmenar/fix-invalid-rm, r=epage
Fix cargo remove incorrectly removing used patches

### What does this PR try to resolve?

Fixes an issue where patches are being removed when member dependencies don't explicitly contain the patched crate.

Fixes #12419

### How should we test and review this PR?

- Created a test for the failing use case
- Verify passing test

<!--
### Additional information

Other information you want to mention in this PR, such as prior arts,
future extensions, an unresolved problem, or a TODO list.

-->
2023-08-10 18:00:32 +00:00
alcolmenar
72e66fb645
fix: add quiet verbosity around resolve and fix tests 2023-08-10 09:51:36 -07:00
alcolmenar
a64ed3976f
fix: add gc unused patches logic and fix tests 2023-08-10 07:27:36 -07:00
alcolmenar
7ad774a3ff
chore: add passing test 2023-08-10 07:27:24 -07:00
alcolmenar
dde256fb93
fix: ensure patches are different dependencies to enable unused 2023-08-09 13:09:41 -07:00
Ed Page
853102f7de fix(cli): Make --help easier to browse
This mirrors some of the categories from `cargo help` (the man pages).
There are fewer categories to avoid extra vertical space.  Instead, they
are left int the `Options` category but put first.
2023-08-08 13:50:05 -05:00
Ed Page
5101372312 test(cli): Track --help output
This makes it easier to evaluate the usability of PRs, like #11905
2023-07-24 17:12:20 -05:00
Ed Page
ad9a44ddde refactor(tests): Reduce cargo-remove setup load
Benefits
- Clarifies a tests needs
- Speeds up testing, especially on Windows
- Reduces disk space issues within CI
2023-05-25 13:43:16 -05:00
Ed Page
6feea34f8a chore: Upgrade to clap v4.2
Tests in `master` are currently failing because its building with clap
v4.2 but the tests have snapshots from v4.1
2023-03-28 05:00:49 -05:00
Weihang Lo
c51c6bb6ac
chore: reflect to clap updates 2023-01-14 09:23:39 +00:00
Cassaundra Smith
299252c78d Clean profile, patch, and replace in cargo remove
After a successful removal of a dependency, clean up the profile, patch, and
replace sections to remove all references to the dependency.
2022-11-18 09:33:37 -06:00
xxchan
a858cc6c4a improve error message for cargo add/remove 2022-11-14 20:32:09 +01:00
Cassaundra Smith
38b23d5c68
Clean up workspace dependencies after cargo remove 2022-11-01 12:08:16 -07:00
Cassaundra Smith
40a387c4bd
Use correct version of cargo in test 2022-10-07 17:03:29 -07:00
Cassaundra Smith
805f424535
Add tests for cargo remove 2022-10-06 13:05:42 -07:00