@@ -720,7 +720,7 @@ public void Command_arguments_show_argument_name_in_first_column()
720
720
new Argument < bool > ( "boolArgument" ) { Description = "Some value" } ,
721
721
new Argument < int > ( "intArgument" ) { Description = "Another value" } ,
722
722
} ;
723
-
723
+
724
724
var helpBuilder = GetHelpBuilder ( SmallMaxWidth ) ;
725
725
726
726
helpBuilder . Write ( command , _console ) ;
@@ -777,16 +777,16 @@ public void Help_describes_default_value_for_argument()
777
777
778
778
help . Should ( ) . Contain ( "[default: the-arg-value]" ) ;
779
779
}
780
-
780
+
781
781
[ Fact ]
782
782
public void Help_does_not_show_default_value_for_argument_when_default_value_is_empty ( )
783
783
{
784
784
var argument = new Argument < string > ( "the-arg" )
785
- {
785
+ {
786
786
Description = "The argument description" ,
787
787
DefaultValueFactory = ( _ ) => ""
788
788
} ;
789
-
789
+
790
790
var command = new Command ( "the-command" , "The command description" )
791
791
{
792
792
argument
@@ -824,6 +824,38 @@ public void Help_does_not_show_default_value_for_option_when_default_value_is_em
824
824
help . Should ( ) . NotContain ( "[default" ) ;
825
825
}
826
826
827
+ [ Flags ]
828
+ public enum Letters
829
+ {
830
+ A = 1 ,
831
+ B = 2
832
+ }
833
+
834
+ [ Fact ]
835
+ public void Help_does_not_show_arguments_for_enum_backed_option_when_arity_is_zero ( )
836
+ {
837
+ var option = new Option < Letters > ( "--all" )
838
+ {
839
+ Description = "Passes both A and B" ,
840
+ Arity = ArgumentArity . Zero ,
841
+ CustomParser = _ => Letters . A | Letters . B
842
+ } ;
843
+
844
+ var command = new Command ( "the-command" , "The command description" )
845
+ {
846
+ option
847
+ } ;
848
+
849
+ var helpBuilder = GetHelpBuilder ( SmallMaxWidth ) ;
850
+
851
+ helpBuilder . Write ( command , _console ) ;
852
+
853
+ var help = _console . ToString ( ) ;
854
+
855
+ help . Should ( ) . NotContain ( "--all <A|B>" ) ;
856
+ }
857
+
858
+
827
859
[ Fact ]
828
860
public void Command_arguments_default_value_provided ( )
829
861
{
@@ -864,7 +896,7 @@ public void Command_arguments_with_default_values_that_are_enumerable_display_pi
864
896
new Argument < List < int > > ( "filter-size" )
865
897
{
866
898
DefaultValueFactory = ( _ ) => new List < int > ( ) { 0 , 2 , 4 }
867
- }
899
+ }
868
900
} ;
869
901
870
902
_helpBuilder . Write ( command , _console ) ;
@@ -905,7 +937,7 @@ public void Command_shared_arguments_with_one_or_more_arity_are_displayed_as_bei
905
937
906
938
_console . ToString ( ) . Should ( ) . Contain ( expected ) ;
907
939
}
908
-
940
+
909
941
#endregion Arguments
910
942
911
943
#region Options
@@ -1491,7 +1523,7 @@ public void Help_describes_default_value_for_subcommand_with_arguments_and_only_
1491
1523
{
1492
1524
Hidden = true
1493
1525
} ;
1494
- argument . DefaultValueFactory = _ => "the-arg-value" ;
1526
+ argument . DefaultValueFactory = _ => "the-arg-value" ;
1495
1527
otherArgumentHidden . DefaultValueFactory = _ => "the-other-hidden-arg-value" ;
1496
1528
1497
1529
var command = new Command ( "outer" , "outer command help" )
0 commit comments