File tree 2 files changed +22
-2
lines changed
2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -888,7 +888,7 @@ impl<'a> Help<'a> {
888
888
parser. meta. about. unwrap_or( "unknown about" ) ) ) ;
889
889
}
890
890
b"usage" => {
891
- try!( write ! ( self . writer, "{}" , usage:: create_help_usage ( parser, true ) ) ) ;
891
+ try!( write ! ( self . writer, "{}" , usage:: create_usage_no_title ( parser, & [ ] ) ) ) ;
892
892
}
893
893
b"all-args" => {
894
894
try!( self . write_all_args ( & parser) ) ;
Original file line number Diff line number Diff line change @@ -686,7 +686,27 @@ fn ripgrep_usage() {
686
686
rg [OPTIONS] --files [<path> ...]
687
687
rg [OPTIONS] --type-list" ) ;
688
688
689
- assert ! ( test:: compare_output( app, "ripgrep --help" , RIPGREP_USAGE , false ) ) ;
689
+ assert ! ( test:: compare_output( app, "rg --help" , RIPGREP_USAGE , false ) ) ;
690
+ }
691
+
692
+ #[ test]
693
+ fn ripgrep_usage_using_templates ( ) {
694
+ let app = App :: new ( "ripgrep" )
695
+ . version ( "0.5" )
696
+ . usage ( "
697
+ rg [OPTIONS] <pattern> [<path> ...]
698
+ rg [OPTIONS] [-e PATTERN | -f FILE ]... [<path> ...]
699
+ rg [OPTIONS] --files [<path> ...]
700
+ rg [OPTIONS] --type-list" )
701
+ . template ( "\
702
+ {bin} {version}
703
+
704
+ USAGE:{usage}
705
+
706
+ FLAGS:
707
+ {flags}" ) ;
708
+
709
+ assert ! ( test:: compare_output( app, "rg --help" , RIPGREP_USAGE , false ) ) ;
690
710
}
691
711
692
712
#[ test]
You can’t perform that action at this time.
0 commit comments