Commit graph

34 commits

Author SHA1 Message Date
Ethan Brierley
9831e83fb2 generalise suggestion on abiguous spec
Fixes #12433
2023-09-18 16:34:17 +01:00
Jordan Rose
a0576d1767 cargo-tree: Handle -e no-proc-macro when building the graph
This is closer to how the edge-based filters work ([no-]build etc.),
and results in a more useful behavior when combined with -i or -d.
2023-04-27 10:54:51 -07:00
Jordan Rose
747a5924a0 test: Add a test for cargo tree --duplicates with a proc-macro 2023-04-27 10:49:22 -07:00
hi-rustin
a3eb31fab4 Fix typo try use -> try to use
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-11-20 18:14:17 +08:00
hi-rustin
c5eb61823c Remove the --all-features tip
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-11-20 16:39:00 +08:00
hi-rustin
a4f89eab03 Add warning when cargo tree -i <spec> can not find packages
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-11-15 09:41:39 +08:00
Ed Page
cdec3838a8 Extend pkgid syntax with @ support
In addition to `foo:1.2.3`, we now support `foo@1.2.3` for pkgids.  We
are also making it the default way of rendering pkgid's for the user.

With cargo-add in #10472, we've decided to only use `@` in it and to add
it as an alternative to `:` in the rest of cargo.  `cargo-add`
originally used `@`.  When preparing it for merge, I switched to `:` to
be consistent with pkgids. When discussing this, it was felt `@` has
precedence in too many tools to switch to `:` but that we should instead
switch pkgid's to use `@`, in a backwards compatible way.

See also https://internals.rust-lang.org/t/feedback-on-cargo-add-before-its-merged/16024/26?u=epage
2022-04-19 16:00:15 -05:00
hi-rustin
58906aac9d Don't treat host/target duplicates as duplicates
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-03-09 00:51:51 +08:00
Eric Huss
2eee644c68 Fix resolve error with cyclic dev-dependency features.
There is a convoluted situation where a cyclic dev-dependency attempts
to enable a feature on its parent. It would result in a confusing error
saying a package didn't have a feature.

This check was intended only for CLI features, not features passed
through the dependency graph.
2021-11-19 18:10:10 -08:00
Eric Huss
d7ab4a6598 cargo tree: Fix stack overflow on cyclic features. 2021-11-19 18:07:31 -08:00
Joe Ardent
af355f0ea5 Use crate_name() on the library target, update tests. 2021-07-12 13:25:49 -07:00
Joe Ardent
bc472c762b Change format character to 'lib'. 2021-07-08 15:59:07 -07:00
Joe Ardent
6fb5a1de54 Add test for lib_name format character. 2021-07-07 00:05:08 -07:00
Weihang Lo
64f5d10113
test(carog-tree): new --prune option 2021-05-29 11:45:10 +08:00
Weihang Lo
da2327f129
Merge branch 'master' into tree-depth 2021-05-28 23:27:42 +08:00
Weihang Lo
62d811d9f7
test(cargo-tree): --depth option 2021-05-19 09:29:47 +08:00
Weihang Lo
a5139b96b9
test: cargo tree incorrect --edges arg 2021-05-16 02:00:56 +08:00
Weihang Lo
c8af63795e
test: assert no-proc-macro for existing tests 2021-05-16 02:00:22 +08:00
Matthias Krüger
1b7fa21f39 fix clippy warnings
fixes these clippy warnings:

map_collect_result_unit
needless_borrow
needless_return
into_iter_on_ref
manual_flatten
match_like_matches_macro
bool_comparison
2021-04-02 12:30:36 +02:00
Eric Huss
d087aeb845 Stabilize -Zfeatures and -Zpackage-features. 2020-12-19 08:26:42 -08:00
Weihang Lo
d613cd66c7
Merge branch 'master' into feat/glob-pattern 2020-10-18 08:48:30 +08:00
Kitsu
d17311df6c Update tree tests 2020-10-10 11:38:52 +03:00
Weihang Lo
ab88c48480
test(tree): glob support for package selection 2020-10-05 01:24:41 +08:00
Eric Huss
6f8c7d5a87 Normalize raw string indentation. 2020-09-26 17:59:58 -07:00
Eric Huss
8ee908d40f Add cross check to filters_target test. 2020-09-18 12:28:33 -07:00
Eric Huss
7c403447bd Switch --invert to take the package name as an argument. 2020-04-03 19:52:21 -07:00
Eric Huss
96ff434cb9 Rename --dep-kinds to --edges and fold in --graph-features. 2020-04-03 19:16:39 -07:00
Eric Huss
3b1df3a46f Change --no-dev-dependencies to --dep-kinds. 2020-04-02 15:12:17 -07:00
Eric Huss
ec5e297b70 Change --no-filter-targets to --target=all. 2020-04-02 12:20:55 -07:00
Eric Huss
a9ff02ed5a Change --no-indent and --prefix-depth to a single --prefix option. 2020-04-02 11:48:52 -07:00
Eric Huss
e1c95e2f42 Fix tree format parsing for bare } 2020-04-02 11:31:39 -07:00
Eric Huss
6868215982 Don't show (*) deduplicate if a node doesn't have any dependencies to show. 2020-04-02 11:25:20 -07:00
Eric Huss
9dc56c6280 Deduplicate nodes across roots. 2020-04-02 11:09:06 -07:00
Eric Huss
96a393719b Add cargo tree command. 2020-03-31 15:14:47 -07:00