File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44#![ cfg_attr( not( feature = "usage" ) , allow( dead_code) ) ]
55
66// Internal
7+ use crate :: builder:: ArgAction ;
78use crate :: builder:: StyledStr ;
89use crate :: builder:: Styles ;
910use crate :: builder:: { ArgPredicate , Command } ;
@@ -210,6 +211,20 @@ impl<'cmd> Usage<'cmd> {
210211 debug ! ( "Usage::needs_options_tag:iter Option is built-in" ) ;
211212 continue ;
212213 }
214+ match f. get_action ( ) {
215+ ArgAction :: Set
216+ | ArgAction :: Append
217+ | ArgAction :: SetTrue
218+ | ArgAction :: SetFalse
219+ | ArgAction :: Count => { }
220+ ArgAction :: Help
221+ | ArgAction :: HelpShort
222+ | ArgAction :: HelpLong
223+ | ArgAction :: Version => {
224+ debug ! ( "Usage::needs_options_tag:iter Option is built-in" ) ;
225+ continue ;
226+ }
227+ }
213228
214229 if f. is_hide_set ( ) {
215230 debug ! ( "Usage::needs_options_tag:iter Option is hidden" ) ;
Original file line number Diff line number Diff line change @@ -1068,7 +1068,7 @@ fn explicit_short_long_help() {
10681068 static SHORT_ABOUT : & str = "\
10691069 bar
10701070
1071- Usage: myapp [OPTIONS] [ arg1]
1071+ Usage: myapp [arg1]
10721072
10731073Arguments:
10741074 [arg1] some option
@@ -1084,7 +1084,7 @@ something really really long, with
10841084multiple lines of text
10851085that should be displayed
10861086
1087- Usage: myapp [OPTIONS] [ arg1]
1087+ Usage: myapp [arg1]
10881088
10891089Arguments:
10901090 [arg1]
@@ -1351,7 +1351,7 @@ fn override_help_short() {
13511351}
13521352
13531353static OVERRIDE_HELP_LONG : & str = "\
1354- Usage: test [OPTIONS]
1354+ Usage: test
13551355
13561356Options:
13571357 -h, --hell Print help
You can’t perform that action at this time.
0 commit comments