File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -198,16 +198,13 @@ fn write_option_description(out: &mut String, arg: &Arg) {
198198}
199199
200200fn get_help_text ( arg : & Arg ) -> Cow < ' static , str > {
201- let help = match ( arg. get_help ( ) , arg. get_long_help ( ) ) {
202- ( None , None ) => return Cow :: Borrowed ( "" ) ,
203- ( Some ( help) , None ) | ( _, Some ( help) ) => help. to_string ( ) ,
204- } ;
205- let help = if help. contains ( "see a summary with" ) && help. contains ( "help" ) {
206- "Print help" . to_string ( )
207- } else {
208- help
209- } ;
210- Cow :: Owned ( help)
201+ if !arg. is_positional ( ) && arg. get_id ( ) == "help" {
202+ return Cow :: Borrowed ( "Print help" ) ;
203+ }
204+ match ( arg. get_help ( ) , arg. get_long_help ( ) ) {
205+ ( None , None ) => Cow :: Borrowed ( "" ) ,
206+ ( Some ( help) , None ) | ( _, Some ( help) ) => Cow :: Owned ( help. to_string ( ) ) ,
207+ }
211208}
212209
213210fn render_examples_section < ' a > ( out : & mut String , lines : impl Iterator < Item = & ' a str > ) {
You can’t perform that action at this time.
0 commit comments