File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed
Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,7 @@ Run with 'cargo -Z [FLAG] [SUBCOMMAND]'"
7272 match command {
7373 CommandInfo :: BuiltIn { name, about } => {
7474 let summary = about. unwrap_or_default ( ) ;
75+ let summary = summary. lines ( ) . next ( ) . unwrap_or ( & summary) ; // display only the first line
7576 println ! ( " {:<20} {}" , name, summary)
7677 }
7778 CommandInfo :: External { name, path } => {
Original file line number Diff line number Diff line change @@ -5,8 +5,11 @@ use cargo::print_json;
55pub fn cli ( ) -> App {
66 subcommand ( "read-manifest" )
77 . about (
8- "Deprecated, use `cargo metadata --no-deps` instead.
9- Print a JSON representation of a Cargo.toml manifest." ,
8+ "\
9+ Print a JSON representation of a Cargo.toml manifest.
10+
11+ Deprecated, use `cargo metadata --no-deps` instead.\
12+ ",
1013 )
1114 . arg_manifest_path ( )
1215}
Original file line number Diff line number Diff line change @@ -70,6 +70,12 @@ fn list_commands_with_descriptions() {
7070 "missing build, with description: {}" ,
7171 output
7272 ) ;
73+ // assert read-manifest prints the right one-line description followed by another command, indented.
74+ assert ! (
75+ output. contains( "\n read-manifest Print a JSON representation of a Cargo.toml manifest.\n " ) ,
76+ "missing build, with description: {}" ,
77+ output
78+ ) ;
7379}
7480
7581#[ test]
You can’t perform that action at this time.
0 commit comments