File tree Expand file tree Collapse file tree 2 files changed +34
-2
lines changed
System.CommandLine.Tests/Help Expand file tree Collapse file tree 2 files changed +34
-2
lines changed Original file line number Diff line number Diff line change @@ -469,6 +469,38 @@ public void Arguments_section_includes_configured_argument_aliases()
469469 help . Should ( ) . Contain ( "Sets the verbosity." ) ;
470470 }
471471
472+
473+ private enum VerbosityOptions
474+ {
475+ quiet ,
476+ q ,
477+ minimal ,
478+ m ,
479+ normal ,
480+ n ,
481+ detailed ,
482+ d ,
483+ diagnostic ,
484+ diag
485+ }
486+
487+ [ Fact ]
488+ public void Arguments_section_uses_name_if_suggestions_are_long ( )
489+ {
490+ var command = new Command ( "the-command" )
491+ {
492+ new Option < VerbosityOptions > ( new [ ] { "-v" , "--verbosity" } )
493+ {
494+ ArgumentHelpName = "LEVEL"
495+ }
496+ } ;
497+
498+ _helpBuilder . Write ( command ) ;
499+
500+ var help = _console . Out . ToString ( ) ;
501+ help . Should ( ) . Contain ( "-v, --verbosity <LEVEL>" ) ;
502+ }
503+
472504 [ Fact ]
473505 public void Arguments_section_uses_description_if_provided ( )
474506 {
@@ -1240,7 +1272,7 @@ public void Help_describes_default_value_for_option_with_argument_having_default
12401272
12411273 help . Should ( ) . Contain ( $ "[default: the-arg-value]") ;
12421274 }
1243-
1275+
12441276 [ Fact ]
12451277 public void Option_arguments_with_default_values_that_are_enumerable_display_pipe_delimited_list ( )
12461278 {
Original file line number Diff line number Diff line change @@ -522,7 +522,7 @@ protected string GetArgumentDescriptor(IArgument argument)
522522
523523 string descriptor ;
524524 var suggestions = argument . GetSuggestions ( ) . ToArray ( ) ;
525- if ( suggestions . Length > 0 )
525+ if ( suggestions . Length > 0 && string . Join ( "|" , suggestions ) . Length < 50 )
526526 {
527527 descriptor = string . Join ( "|" , suggestions ) ;
528528 }
You can’t perform that action at this time.
0 commit comments