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]'"
72
72
match command {
73
73
CommandInfo :: BuiltIn { name, about } => {
74
74
let summary = about. unwrap_or_default ( ) ;
75
+ let summary = summary. lines ( ) . next ( ) . unwrap_or ( & summary) ; // display only the first line
75
76
println ! ( " {:<20} {}" , name, summary)
76
77
}
77
78
CommandInfo :: External { name, path } => {
Original file line number Diff line number Diff line change @@ -5,8 +5,11 @@ use cargo::print_json;
5
5
pub fn cli ( ) -> App {
6
6
subcommand ( "read-manifest" )
7
7
. 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
+ ",
10
13
)
11
14
. arg_manifest_path ( )
12
15
}
Original file line number Diff line number Diff line change @@ -70,6 +70,12 @@ fn list_commands_with_descriptions() {
70
70
"missing build, with description: {}" ,
71
71
output
72
72
) ;
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
+ ) ;
73
79
}
74
80
75
81
#[ test]
You can’t perform that action at this time.
0 commit comments