/** * Adds a row of option help output in the left column, with empty space in the right column. * * @param single text to put in the left column */ protected void addOptionRow( String single ) { addOptionRow( single, "" ); }
/** * Adds a row of option help output in the left column, with empty space in the right column. * * @param single text to put in the left column */ protected void addOptionRow( String single ) { addOptionRow( single, "" ); }
/** * <p>Adds help row headers for option help columns.</p> * * <p>This implementation uses the headers {@code "Option"} and {@code "Description"}. If the options contain * a "required" option, the {@code "Option"} header looks like {@code "Option (* = required)}. Both headers * are "underlined" using {@code "-"}.</p> * * @param options descriptors for the configured options of a parser */ protected void addHeaders( Collection<? extends OptionDescriptor> options ) { if ( hasRequiredOption( options ) ) { addOptionRow( message( "option.header.with.required.indicator" ), message( "description.header" ) ); addOptionRow( message( "option.divider.with.required.indicator" ), message( "description.divider" ) ); } else { addOptionRow( message( "option.header" ), message( "description.header" ) ); addOptionRow( message( "option.divider" ), message( "description.divider" ) ); } }
/** * <p>Adds help row headers for option help columns.</p> * * <p>This implementation uses the headers {@code "Option"} and {@code "Description"}. If the options contain * a "required" option, the {@code "Option"} header looks like {@code "Option (* = required)}. Both headers * are "underlined" using {@code "-"}.</p> * * @param options descriptors for the configured options of a parser */ protected void addHeaders( Collection<? extends OptionDescriptor> options ) { if ( hasRequiredOption( options ) ) { addOptionRow( message( "option.header.with.required.indicator" ), message( "description.header" ) ); addOptionRow( message( "option.divider.with.required.indicator" ), message( "description.divider" ) ); } else { addOptionRow( message( "option.header" ), message( "description.header" ) ); addOptionRow( message( "option.divider" ), message( "description.divider" ) ); } }
/** * <p>Adds help rows for the given options.</p> * * <p>This implementation loops over the given options, and for each, calls {@link #addOptionRow(String, String)} * using the results of {@link #createOptionDisplay(OptionDescriptor)} and * {@link #createDescriptionDisplay(OptionDescriptor)}, respectively, as arguments.</p> * * @param options descriptors for the configured options of a parser */ protected void addOptions( Collection<? extends OptionDescriptor> options ) { for ( OptionDescriptor each : options ) { if ( !each.representsNonOptions() ) addOptionRow( createOptionDisplay( each ), createDescriptionDisplay( each ) ); } }
/** * <p>Adds help rows for the given options.</p> * * <p>This implementation loops over the given options, and for each, calls {@link #addOptionRow(String, String)} * using the results of {@link #createOptionDisplay(OptionDescriptor)} and * {@link #createDescriptionDisplay(OptionDescriptor)}, respectively, as arguments.</p> * * @param options descriptors for the configured options of a parser */ protected void addOptions( Collection<? extends OptionDescriptor> options ) { for ( OptionDescriptor each : options ) { if ( !each.representsNonOptions() ) addOptionRow( createOptionDisplay( each ), createDescriptionDisplay( each ) ); } }
/** * <p>Adds rows of help output for the given options.</p> * * <p>This implementation:</p> * <ul> * <li>Calls {@link #addNonOptionsDescription(java.util.Collection)} with the options as the argument</li> * <li>If there are no options, calls {@link #addOptionRow(String)} with an argument that indicates * that no options are specified.</li> * <li>Otherwise, calls {@link #addHeaders(java.util.Collection)} with the options as the argument, * followed by {@link #addOptions(java.util.Collection)} with the options as the argument.</li> * <li>Calls {@link #fitRowsToWidth()}.</li> * </ul> * * @param options descriptors for the configured options of a parser */ protected void addRows( Collection<? extends OptionDescriptor> options ) { addNonOptionsDescription( options ); if ( options.isEmpty() ) addOptionRow( message( "no.options.specified" ) ); else { addHeaders( options ); addOptions( options ); } fitRowsToWidth(); }
/** * <p>Adds rows of help output for the given options.</p> * * <p>This implementation:</p> * <ul> * <li>Calls {@link #addNonOptionsDescription(java.util.Collection)} with the options as the argument</li> * <li>If there are no options, calls {@link #addOptionRow(String)} with an argument that indicates * that no options are specified.</li> * <li>Otherwise, calls {@link #addHeaders(java.util.Collection)} with the options as the argument, * followed by {@link #addOptions(java.util.Collection)} with the options as the argument.</li> * <li>Calls {@link #fitRowsToWidth()}.</li> * </ul> * * @param options descriptors for the configured options of a parser */ protected void addRows( Collection<? extends OptionDescriptor> options ) { addNonOptionsDescription( options ); if ( options.isEmpty() ) addOptionRow( message( "no.options.specified" ) ); else { addHeaders( options ); addOptions( options ); } fitRowsToWidth(); }