File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed
tests/testsuite/cargo_tree/dupe Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 11use crate :: cli;
22use crate :: command_prelude:: * ;
3+ use annotate_snippets:: Level ;
34use anyhow:: { bail, format_err} ;
45use cargo:: core:: dependency:: DepKind ;
56use cargo:: ops:: Packages ;
@@ -141,10 +142,16 @@ pub fn exec(gctx: &mut GlobalContext, args: &ArgMatches) -> CliResult {
141142
142143 let no_dedupe = args. flag ( "no-dedupe" ) || args. flag ( "all" ) ;
143144 if args. flag ( "all" ) {
144- gctx. shell ( ) . warn (
145- "The `cargo tree` --all flag has been changed to --no-dedupe, \
146- and may be removed in a future version.\n \
147- If you are looking to display all workspace members, use the --workspace flag.",
145+ gctx. shell ( ) . print_report (
146+ & [ Level :: WARNING
147+ . secondary_title (
148+ "the `cargo tree` --all flag has been changed to --no-dedupe, \
149+ and may be removed in a future version)",
150+ )
151+ . element ( Level :: HELP . message (
152+ "if you are looking to display all workspace members, use the --workspace flag" ,
153+ ) ) ] ,
154+ false ,
148155 ) ?;
149156 }
150157
Original file line number Diff line number Diff line change @@ -60,8 +60,9 @@ fn all_flag() {
6060 . build ( ) ;
6161
6262 p. cargo ( "tree --all" ) . with_stderr_data ( str![ [ r#"
63- [WARNING] The `cargo tree` --all flag has been changed to --no-dedupe, and may be removed in a future version.
64- If you are looking to display all workspace members, use the --workspace flag.
63+ [WARNING] the `cargo tree` --all flag has been changed to --no-dedupe, and may be removed in a future version)
64+ |
65+ = [HELP] if you are looking to display all workspace members, use the --workspace flag
6566...
6667"# ] ] ) . run ( ) ;
6768}
You can’t perform that action at this time.
0 commit comments