private void appendOptionGroup ( StringBuffer buff , OptionGroup group ) { if ( ! group . isRequired ( ) ) { buff . append ( "[" ) ; } List < Option > optList = new ArrayList < Option > ( group . getOptions ( ) ) ; if ( getOptionComparator ( ) != null ) { Collections . sort ( optList , getOptionComparator ( ) ) ; } // for each option in the OptionGroup for ( Iterator < Option > it = optList . iterator ( ) ; it . hasNext ( ) ; ) { // whether the option is required or not is handled at group level appendOption ( buff , it . next ( ) , true ) ; if ( it . hasNext ( ) ) { buff . append ( " | " ) ; } } if ( ! group . isRequired ( ) ) { buff . append ( "]" ) ; } }
Appends the usage clause for an OptionGroup to a StringBuffer . The clause is wrapped in square brackets if the group is required . The display of the options is handled by appendOption