File tree Expand file tree Collapse file tree
src/java/org/apache/commons/cli/avalon Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,12 +46,15 @@ public static final StringBuffer describeOptions( final CLOptionDescriptor[] opt
4646 final String name = options [i ].getName ();
4747 String description = options [i ].getDescription ();
4848 int flags = options [i ].getFlags ();
49+ boolean argumentOptional =
50+ ((flags & CLOptionDescriptor .ARGUMENT_OPTIONAL ) ==
51+ CLOptionDescriptor .ARGUMENT_OPTIONAL );
4952 boolean argumentRequired =
5053 ((flags & CLOptionDescriptor .ARGUMENT_REQUIRED ) ==
51- CLOptionDescriptor .ARGUMENT_REQUIRED );
54+ CLOptionDescriptor .ARGUMENT_REQUIRED );
5255 boolean twoArgumentsRequired =
5356 ((flags & CLOptionDescriptor .ARGUMENTS_REQUIRED_2 ) ==
54- CLOptionDescriptor .ARGUMENTS_REQUIRED_2 );
57+ CLOptionDescriptor .ARGUMENTS_REQUIRED_2 );
5558 boolean needComma = false ;
5659 if ( twoArgumentsRequired )
5760 {
@@ -78,6 +81,10 @@ public static final StringBuffer describeOptions( final CLOptionDescriptor[] opt
7881 sb .append ( name );
7982 }
8083
84+ if (argumentOptional )
85+ {
86+ sb .append (" [[=]<argument>]" );
87+ }
8188 if ( argumentRequired )
8289 {
8390 sb .append ( " <argument>" );
You can’t perform that action at this time.
0 commit comments