Modified:
websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/HelpFormatter.java.html
==============================================================================
---
websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/HelpFormatter.java.html
(original)
+++
websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/HelpFormatter.java.html
Thu Aug 15 00:03:23 2024
@@ -22,6 +22,7 @@ import java.io.IOException;
import java.io.PrintWriter;
import java.io.Serializable;
import java.io.StringReader;
+import java.io.UncheckedIOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
@@ -71,28 +72,31 @@ public class HelpFormatter {
*
* @since 1.7.0
*/
-<span class="fc" id="L74"> public static final class Builder implements
Supplier<HelpFormatter> {</span>
+<span class="nc" id="L75"> public static class Builder implements
Supplier<HelpFormatter> {</span>
// TODO All other instance HelpFormatter instance variables.
// Make HelpFormatter immutable for 2.0
/**
* A function to convert a description (not null) and a deprecated
Option (not null) to help description
*/
-<span class="fc" id="L81"> private static final Function<Option,
String> DEFAULT_DEPRECATED_FORMAT = o -> "[Deprecated] " +
getDescription(o);</span>
+<span class="nc" id="L82"> private static final Function<Option,
String> DEFAULT_DEPRECATED_FORMAT = o -> "[Deprecated] " +
getDescription(o);</span>
/**
* Formatter for deprecated options.
*/
-<span class="fc" id="L86"> private Function<Option, String>
deprecatedFormatFunc = DEFAULT_DEPRECATED_FORMAT;</span>
+<span class="nc" id="L87"> private Function<Option, String>
deprecatedFormatFunction = DEFAULT_DEPRECATED_FORMAT;</span>
/**
* The output PrintWriter, defaults to wrapping {@link System#out}.
*/
-<span class="fc" id="L91"> private PrintWriter printStream =
createDefaultPrintWriter();</span>
+<span class="nc" id="L92"> private PrintWriter printStream =
createDefaultPrintWriter();</span>
+
+ /** The flag to determine if the since values should be dispalyed */
+ private boolean showSince;
@Override
public HelpFormatter get() {
-<span class="fc" id="L95"> return new
HelpFormatter(deprecatedFormatFunc, printStream);</span>
+<span class="nc" id="L99"> return new
HelpFormatter(deprecatedFormatFunction, printStream, showSince);</span>
}
/**
@@ -102,8 +106,8 @@ public class HelpFormatter {
* @return {@code this} instance.
*/
public Builder setPrintWriter(final PrintWriter printWriter) {
-<span class="fc" id="L105"> this.printStream =
Objects.requireNonNull(printWriter, "printWriter");</span>
-<span class="fc" id="L106"> return this;</span>
+<span class="nc" id="L109"> this.printStream =
Objects.requireNonNull(printWriter, "printWriter");</span>
+<span class="nc" id="L110"> return this;</span>
}
/**
@@ -113,19 +117,30 @@ public class HelpFormatter {
* @return {@code this} instance.
*/
public Builder setShowDeprecated(final boolean useDefaultFormat) {
-<span class="fc bfc" id="L116" title="All 2 branches covered.">
return setShowDeprecated(useDefaultFormat ? DEFAULT_DEPRECATED_FORMAT :
null);</span>
+<span class="nc bnc" id="L120" title="All 2 branches missed.">
return setShowDeprecated(useDefaultFormat ? DEFAULT_DEPRECATED_FORMAT :
null);</span>
}
/**
* Sets whether to show deprecated options.
*
- * @param showDeprecatedFunc Specify the format for the deprecated
options.
+ * @param deprecatedFormatFunction Specify the format for the
deprecated options.
* @return {@code this} instance.
* @since 1.8.0
*/
- public Builder setShowDeprecated(final Function<Option, String>
showDeprecatedFunc) {
-<span class="fc" id="L127"> this.deprecatedFormatFunc =
showDeprecatedFunc;</span>
-<span class="fc" id="L128"> return this;</span>
+ public Builder setShowDeprecated(final Function<Option, String>
deprecatedFormatFunction) {
+<span class="nc" id="L131"> this.deprecatedFormatFunction =
deprecatedFormatFunction;</span>
+<span class="nc" id="L132"> return this;</span>
+ }
+
+ /**
+ * Sets whether to show the date the option was first added.
+ * @param showSince if @{code true} the date the options was first
added will be shown.
+ * @return this builder.
+ * @since 1.9.0
+ */
+ public Builder setShowSince(final boolean showSince) {
+<span class="nc" id="L142"> this.showSince = showSince;</span>
+<span class="nc" id="L143"> return this;</span>
}
}
@@ -148,9 +163,18 @@ public class HelpFormatter {
*/
@Override
public int compare(final Option opt1, final Option opt2) {
-<span class="fc" id="L151"> return
opt1.getKey().compareToIgnoreCase(opt2.getKey());</span>
+<span class="nc" id="L166"> return
opt1.getKey().compareToIgnoreCase(opt2.getKey());</span>
}
}
+ /** "Options" text for options header */
+ private static final String HEADER_OPTIONS = "Options";
+
+ /** "Since" text for options header */
+ private static final String HEADER_SINCE = "Since";
+
+ /** "Description" test for options header */
+ private static final String HEADER_DESCRIPTION = "Description";
+
/** Default number of characters per line */
public static final int DEFAULT_WIDTH = 74;
@@ -186,11 +210,11 @@ public class HelpFormatter {
* @since 1.7.0
*/
public static Builder builder() {
-<span class="fc" id="L189"> return new Builder();</span>
+<span class="nc" id="L213"> return new Builder();</span>
}
private static PrintWriter createDefaultPrintWriter() {
-<span class="fc" id="L193"> return new PrintWriter(System.out);</span>
+<span class="nc" id="L217"> return new PrintWriter(System.out);</span>
}
/**
@@ -200,8 +224,8 @@ public class HelpFormatter {
* @since 1.8.0
*/
public static String getDescription(final Option option) {
-<span class="fc" id="L203"> final String desc =
option.getDescription();</span>
-<span class="fc bfc" id="L204" title="All 2 branches covered."> return
desc == null ? "" : desc;</span>
+<span class="nc" id="L227"> final String desc =
option.getDescription();</span>
+<span class="nc bnc" id="L228" title="All 2 branches missed."> return
desc == null ? "" : desc;</span>
}
/**
@@ -209,104 +233,108 @@ public class HelpFormatter {
*
* @deprecated Scope will be made private for next major version - use
get/setWidth methods instead.
*/
-<span class="fc" id="L212"> @Deprecated</span>
- public int defaultWidth = DEFAULT_WIDTH;
+ @Deprecated
+<span class="nc" id="L237"> public int defaultWidth = DEFAULT_WIDTH;</span>
/**
* Amount of padding to the left of each line
*
* @deprecated Scope will be made private for next major version - use
get/setLeftPadding methods instead.
*/
-<span class="fc" id="L220"> @Deprecated</span>
- public int defaultLeftPad = DEFAULT_LEFT_PAD;
+ @Deprecated
+<span class="nc" id="L245"> public int defaultLeftPad =
DEFAULT_LEFT_PAD;</span>
/**
* The number of characters of padding to be prefixed to each description
line
*
* @deprecated Scope will be made private for next major version - use
get/setDescPadding methods instead.
*/
-<span class="fc" id="L228"> @Deprecated</span>
- public int defaultDescPad = DEFAULT_DESC_PAD;
+ @Deprecated
+<span class="nc" id="L253"> public int defaultDescPad =
DEFAULT_DESC_PAD;</span>
/**
* The string to display at the beginning of the usage statement
*
* @deprecated Scope will be made private for next major version - use
get/setSyntaxPrefix methods instead.
*/
-<span class="fc" id="L236"> @Deprecated</span>
- public String defaultSyntaxPrefix = DEFAULT_SYNTAX_PREFIX;
+ @Deprecated
+<span class="nc" id="L261"> public String defaultSyntaxPrefix =
DEFAULT_SYNTAX_PREFIX;</span>
/**
* The new line string
*
* @deprecated Scope will be made private for next major version - use
get/setNewLine methods instead.
*/
-<span class="fc" id="L244"> @Deprecated</span>
-<span class="fc" id="L245"> public String defaultNewLine =
System.lineSeparator();</span>
+ @Deprecated
+<span class="nc" id="L269"> public String defaultNewLine =
System.lineSeparator();</span>
/**
* The shortOpt prefix
*
* @deprecated Scope will be made private for next major version - use
get/setOptPrefix methods instead.
*/
-<span class="fc" id="L252"> @Deprecated</span>
- public String defaultOptPrefix = DEFAULT_OPT_PREFIX;
+ @Deprecated
+<span class="nc" id="L277"> public String defaultOptPrefix =
DEFAULT_OPT_PREFIX;</span>
/**
* The long Opt prefix
*
* @deprecated Scope will be made private for next major version - use
get/setLongOptPrefix methods instead.
*/
-<span class="fc" id="L260"> @Deprecated</span>
- public String defaultLongOptPrefix = DEFAULT_LONG_OPT_PREFIX;
+ @Deprecated
+<span class="nc" id="L285"> public String defaultLongOptPrefix =
DEFAULT_LONG_OPT_PREFIX;</span>
/**
* The name of the argument
*
* @deprecated Scope will be made private for next major version - use
get/setArgName methods instead.
*/
-<span class="fc" id="L268"> @Deprecated</span>
- public String defaultArgName = DEFAULT_ARG_NAME;
+ @Deprecated
+<span class="nc" id="L293"> public String defaultArgName =
DEFAULT_ARG_NAME;</span>
/**
* Comparator used to sort the options when they output in help text
*
* Defaults to case-insensitive alphabetical sorting by option key
*/
-<span class="fc" id="L276"> protected Comparator<Option>
optionComparator = new OptionComparator();</span>
+<span class="nc" id="L300"> protected Comparator<Option>
optionComparator = new OptionComparator();</span>
/**
* Function to format the description for a deprecated option.
*/
- private final Function<Option, String> deprecatedFormatFunc;
+ private final Function<Option, String> deprecatedFormatFunction;
/**
* Where to print help.
*/
private final PrintWriter printWriter;
+ /** Flag to determine if since field should be displayed */
+ private final boolean showSince;
+
/**
* The separator displayed between the long option and its value.
*/
-<span class="fc" id="L291"> private String longOptSeparator =
DEFAULT_LONG_OPT_SEPARATOR;</span>
+<span class="nc" id="L318"> private String longOptSeparator =
DEFAULT_LONG_OPT_SEPARATOR;</span>
/**
* Constructs a new instance.
*/
public HelpFormatter() {
-<span class="fc" id="L297"> this(null,
createDefaultPrintWriter());</span>
-<span class="fc" id="L298"> }</span>
+<span class="nc" id="L324"> this(null, createDefaultPrintWriter(),
false);</span>
+<span class="nc" id="L325"> }</span>
/**
* Constructs a new instance.
- * @param printStream TODO
+ * @param printWriter TODO
*/
-<span class="fc" id="L304"> private HelpFormatter(final Function<Option,
String> deprecatedFormatFunc, final PrintWriter printStream) {</span>
+<span class="nc" id="L331"> private HelpFormatter(final Function<Option,
String> deprecatedFormatFunction, final PrintWriter printWriter, final
boolean showSince) {</span>
// TODO All other instance HelpFormatter instance variables.
// Make HelpFormatter immutable for 2.0
-<span class="fc" id="L307"> this.deprecatedFormatFunc =
deprecatedFormatFunc;</span>
-<span class="fc" id="L308"> this.printWriter = printStream;</span>
-<span class="fc" id="L309"> }</span>
+<span class="nc" id="L334"> this.deprecatedFormatFunction =
deprecatedFormatFunction;</span>
+<span class="nc" id="L335"> this.printWriter = printWriter;</span>
+<span class="nc" id="L336"> this.showSince = showSince;</span>
+<span class="nc" id="L337"> }</span>
/**
* Appends the usage clause for an Option to a StringBuffer.
@@ -315,57 +343,179 @@ public class HelpFormatter {
* @param option the Option to append
* @param required whether the Option is required or not
*/
- private void appendOption(final StringBuffer buff, final Option option,
final boolean required) {
-<span class="fc bfc" id="L319" title="All 2 branches covered."> if
(!required) {</span>
-<span class="fc" id="L320"> buff.append("[");</span>
- }
-<span class="fc bfc" id="L322" title="All 2 branches covered."> if
(option.getOpt() != null) {</span>
-<span class="fc" id="L323">
buff.append("-").append(option.getOpt());</span>
- } else {
-<span class="fc" id="L325">
buff.append("--").append(option.getLongOpt());</span>
+ private void appendOption(final StringBuilder buff, final Option option,
final boolean required) {
+<span class="nc bnc" id="L347" title="All 2 branches missed."> if
(!required) {</span>
+<span class="nc" id="L348"> buff.append("[");</span>
+ }
+<span class="nc bnc" id="L350" title="All 2 branches missed."> if
(option.getOpt() != null) {</span>
+<span class="nc" id="L351">
buff.append("-").append(option.getOpt());</span>
+<span class="nc" id="L352"> } else {</span>
+<span class="nc" id="L353">
buff.append("--").append(option.getLongOpt());</span>
}
// if the Option has a value and a non blank argname
-<span class="fc bfc" id="L328" title="All 6 branches covered."> if
(option.hasArg() && (option.getArgName() == null ||
!option.getArgName().isEmpty())) {</span>
-<span class="fc bfc" id="L329" title="All 2 branches covered.">
buff.append(option.getOpt() == null ? longOptSeparator : " ");</span>
-<span class="fc bfc" id="L330" title="All 2 branches covered.">
buff.append("<").append(option.getArgName() != null ?
option.getArgName() : getArgName()).append(">");</span>
+<span class="nc bnc" id="L356" title="All 6 branches missed."> if
(option.hasArg() && (option.getArgName() == null ||
!option.getArgName().isEmpty())) {</span>
+<span class="nc bnc" id="L357" title="All 2 branches missed.">
buff.append(option.getOpt() == null ? longOptSeparator : " ");</span>
+<span class="nc bnc" id="L358" title="All 2 branches missed.">
buff.append("<").append(option.getArgName() != null ?
option.getArgName() : getArgName()).append(">");</span>
}
// if the Option is not a required option
-<span class="fc bfc" id="L333" title="All 2 branches covered."> if
(!required) {</span>
-<span class="fc" id="L334"> buff.append("]");</span>
+<span class="nc bnc" id="L361" title="All 2 branches missed."> if
(!required) {</span>
+<span class="nc" id="L362"> buff.append("]");</span>
}
-<span class="fc" id="L336"> }</span>
+<span class="nc" id="L364"> }</span>
/**
* 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
*
- * @param buff the StringBuffer to append to
+ * @param buff the StringBuilder to append to
* @param group the group to append
- * @see #appendOption(StringBuffer,Option,boolean)
+ * @see #appendOption(StringBuilder,Option,boolean)
*/
- private void appendOptionGroup(final StringBuffer buff, final OptionGroup
group) {
-<span class="fc bfc" id="L347" title="All 2 branches covered."> if
(!group.isRequired()) {</span>
-<span class="fc" id="L348"> buff.append("[");</span>
- }
-
-<span class="fc" id="L351"> final List<Option> optList = new
ArrayList<>(group.getOptions());</span>
-<span class="pc bpc" id="L352" title="1 of 2 branches missed."> if
(getOptionComparator() != null) {</span>
-<span class="fc" id="L353"> Collections.sort(optList,
getOptionComparator());</span>
+ private void appendOptionGroup(final StringBuilder buff, final OptionGroup
group) {
+<span class="nc bnc" id="L375" title="All 2 branches missed."> if
(!group.isRequired()) {</span>
+<span class="nc" id="L376"> buff.append("[");</span>
+ }
+<span class="nc" id="L378"> final List<Option> optList = new
ArrayList<>(group.getOptions());</span>
+<span class="nc bnc" id="L379" title="All 2 branches missed."> if
(getOptionComparator() != null) {</span>
+<span class="nc" id="L380"> Collections.sort(optList,
getOptionComparator());</span>
}
// for each option in the OptionGroup
-<span class="fc bfc" id="L356" title="All 2 branches covered."> for
(final Iterator<Option> it = optList.iterator(); it.hasNext();) {</span>
+<span class="nc bnc" id="L383" title="All 2 branches missed."> for
(final Iterator<Option> it = optList.iterator(); it.hasNext();) {</span>
// whether the option is required or not is handled at group level
-<span class="fc" id="L358"> appendOption(buff, it.next(),
true);</span>
+<span class="nc" id="L385"> appendOption(buff, it.next(),
true);</span>
-<span class="fc bfc" id="L360" title="All 2 branches covered."> if
(it.hasNext()) {</span>
-<span class="fc" id="L361"> buff.append(" | ");</span>
+<span class="nc bnc" id="L387" title="All 2 branches missed."> if
(it.hasNext()) {</span>
+<span class="nc" id="L388"> buff.append(" | ");</span>
}
}
+<span class="nc bnc" id="L391" title="All 2 branches missed."> if
(!group.isRequired()) {</span>
+<span class="nc" id="L392"> buff.append("]");</span>
+ }
+<span class="nc" id="L394"> }</span>
-<span class="fc bfc" id="L365" title="All 2 branches covered."> if
(!group.isRequired()) {</span>
-<span class="fc" id="L366"> buff.append("]");</span>
+ /**
+ * Renders the specified Options and return the rendered Options in a
StringBuffer.
+ *
+ * @param sb The StringBuffer to place the rendered Options into.
+ * @param width The number of characters to display per line
+ * @param options The command line Options
+ * @param leftPad the number of characters of padding to be prefixed to
each line
+ * @param descPad the number of characters of padding to be prefixed to
each description line
+ * @return the StringBuffer with the rendered Options contents.
+ * @throws IOException if an I/O error occurs.
+ */
+ <A extends Appendable> A appendOptions(final A sb, final int width,
final Options options, final int leftPad, final int descPad) throws IOException
{
+<span class="nc" id="L408"> final String lpad =
createPadding(leftPad);</span>
+<span class="nc" id="L409"> final String dpad =
createPadding(descPad);</span>
+ // first create list containing only <lpad>-a,--aaa where
+ // -a is opt and --aaa is long opt; in parallel look for
+ // the longest opt string this list will be then used to
+ // sort options ascending
+<span class="nc" id="L414"> int max = 0;</span>
+<span class="nc bnc" id="L415" title="All 2 branches missed."> final
int maxSince = showSince ? determineMaxSinceLength(options) + leftPad :
0;</span>
+<span class="nc" id="L416"> final List<StringBuilder> prefixList
= new ArrayList<>();</span>
+<span class="nc" id="L417"> final List<Option> optList =
options.helpOptions();</span>
+<span class="nc bnc" id="L418" title="All 2 branches missed."> if
(getOptionComparator() != null) {</span>
+<span class="nc" id="L419"> Collections.sort(optList,
getOptionComparator());</span>
+ }
+<span class="nc bnc" id="L421" title="All 2 branches missed."> for
(final Option option : optList) {</span>
+<span class="nc" id="L422"> final StringBuilder optBuf = new
StringBuilder();</span>
+<span class="nc bnc" id="L423" title="All 2 branches missed."> if
(option.getOpt() == null) {</span>
+<span class="nc" id="L424"> optBuf.append(lpad).append("
").append(getLongOptPrefix()).append(option.getLongOpt());</span>
+<span class="nc" id="L425"> } else {</span>
+<span class="nc" id="L426">
optBuf.append(lpad).append(getOptPrefix()).append(option.getOpt());</span>
+<span class="nc bnc" id="L427" title="All 2 branches missed.">
if (option.hasLongOpt()) {</span>
+<span class="nc" id="L428">
optBuf.append(',').append(getLongOptPrefix()).append(option.getLongOpt());</span>
+ }
+ }
+<span class="nc bnc" id="L431" title="All 2 branches missed."> if
(option.hasArg()) {</span>
+<span class="nc" id="L432"> final String argName =
option.getArgName();</span>
+<span class="nc bnc" id="L433" title="All 4 branches missed.">
if (argName != null && argName.isEmpty()) {</span>
+ // if the option has a blank argname
+<span class="nc" id="L435"> optBuf.append(' ');</span>
+<span class="nc" id="L436"> } else {</span>
+<span class="nc bnc" id="L437" title="All 2 branches missed.">
optBuf.append(option.hasLongOpt() ? longOptSeparator : " ");</span>
+<span class="nc bnc" id="L438" title="All 2 branches missed.">
optBuf.append("<").append(argName != null ? option.getArgName()
: getArgName()).append(">");</span>
+ }
+ }
+
+<span class="nc" id="L442"> prefixList.add(optBuf);</span>
+<span class="nc" id="L443"> max = Math.max(optBuf.length() +
maxSince, max);</span>
}
-<span class="fc" id="L368"> }</span>
+<span class="nc" id="L445"> final int nextLineTabStop = max +
descPad;</span>
+<span class="nc bnc" id="L446" title="All 2 branches missed."> if
(showSince) {</span>
+<span class="nc" id="L447"> final StringBuilder optHeader = new
StringBuilder(HEADER_OPTIONS).append(createPadding(max - maxSince -
HEADER_OPTIONS.length() + leftPad))</span>
+<span class="nc" id="L448"> .append(HEADER_SINCE);</span>
+<span class="nc" id="L449"> optHeader.append(createPadding(max -
optHeader.length())).append(lpad).append(HEADER_DESCRIPTION);</span>
+<span class="nc" id="L450"> appendWrappedText(sb, width,
nextLineTabStop, optHeader.toString());</span>
+<span class="nc" id="L451"> sb.append(getNewLine());</span>
+ }
+
+<span class="nc" id="L454"> int x = 0;</span>
+<span class="nc bnc" id="L455" title="All 2 branches missed."> for
(final Iterator<Option> it = optList.iterator(); it.hasNext();) {</span>
+<span class="nc" id="L456"> final Option option = it.next();</span>
+<span class="nc" id="L457"> final StringBuilder optBuf = new
StringBuilder(prefixList.get(x++).toString());</span>
+<span class="nc bnc" id="L458" title="All 2 branches missed."> if
(optBuf.length() < max) {</span>
+<span class="nc" id="L459"> optBuf.append(createPadding(max -
maxSince - optBuf.length()));</span>
+<span class="nc bnc" id="L460" title="All 2 branches missed.">
if (showSince) {</span>
+<span class="nc bnc" id="L461" title="All 2 branches missed.">
optBuf.append(lpad).append(option.getSince() == null ? "-" :
option.getSince());</span>
+ }
+<span class="nc" id="L463"> optBuf.append(createPadding(max -
optBuf.length()));</span>
+ }
+<span class="nc" id="L465"> optBuf.append(dpad);</span>
+
+<span class="nc bnc" id="L467" title="All 4 branches missed."> if
(deprecatedFormatFunction != null && option.isDeprecated()) {</span>
+<span class="nc" id="L468">
optBuf.append(deprecatedFormatFunction.apply(option).trim());</span>
+<span class="nc bnc" id="L469" title="All 2 branches missed."> }
else if (option.getDescription() != null) {</span>
+<span class="nc" id="L470">
optBuf.append(option.getDescription());</span>
+ }
+<span class="nc" id="L472"> appendWrappedText(sb, width,
nextLineTabStop, optBuf.toString());</span>
+<span class="nc bnc" id="L473" title="All 2 branches missed."> if
(it.hasNext()) {</span>
+<span class="nc" id="L474"> sb.append(getNewLine());</span>
+ }
+ }
+<span class="nc" id="L477"> return sb;</span>
+ }
+
+ /**
+ * Renders the specified text and return the rendered Options in a
StringBuffer.
+ *
+ * @param <A> The Appendable implementation.
+ * @param appendable The StringBuffer to place the rendered text into.
+ * @param width The number of characters to display per line
+ * @param nextLineTabStop The position on the next line for the first tab.
+ * @param text The text to be rendered.
+ * @return the StringBuffer with the rendered Options contents.
+ * @throws IOException if an I/O error occurs.
+ */
+ <A extends Appendable> A appendWrappedText(final A appendable, final
int width, final int nextLineTabStop, final String text) throws IOException {
+<span class="nc" id="L492"> String render = text;</span>
+<span class="nc" id="L493"> int nextLineTabStopPos =
nextLineTabStop;</span>
+<span class="nc" id="L494"> int pos = findWrapPos(render, width,
0);</span>
+<span class="nc bnc" id="L495" title="All 2 branches missed."> if (pos
== -1) {</span>
+<span class="nc" id="L496"> appendable.append(rtrim(render));</span>
+<span class="nc" id="L497"> return appendable;</span>
+ }
+<span class="nc" id="L499"> appendable.append(rtrim(render.substring(0,
pos))).append(getNewLine());</span>
+<span class="nc bnc" id="L500" title="All 2 branches missed."> if
(nextLineTabStopPos >= width) {</span>
+ // stops infinite loop happening
+<span class="nc" id="L502"> nextLineTabStopPos = 1;</span>
+ }
+ // all following lines must be padded with nextLineTabStop space
characters
+<span class="nc" id="L505"> final String padding =
createPadding(nextLineTabStopPos);</span>
+<span class="nc" id="L506"> while (true) {</span>
+<span class="nc" id="L507"> render = padding +
render.substring(pos).trim();</span>
+<span class="nc" id="L508"> pos = findWrapPos(render, width,
0);</span>
+<span class="nc bnc" id="L509" title="All 2 branches missed."> if
(pos == -1) {</span>
+<span class="nc" id="L510"> appendable.append(render);</span>
+<span class="nc" id="L511"> return appendable;</span>
+ }
+<span class="nc bnc" id="L513" title="All 4 branches missed."> if
(render.length() > width && pos == nextLineTabStopPos - 1) {</span>
+<span class="nc" id="L514"> pos = width;</span>
+ }
+<span class="nc" id="L516">
appendable.append(rtrim(render.substring(0, pos))).append(getNewLine());</span>
+ }
+ }
/**
* Creates a String of padding of length {@code len}.
@@ -375,9 +525,15 @@ public class HelpFormatter {
* @return The String of padding
*/
protected String createPadding(final int len) {
-<span class="fc" id="L378"> final char[] padding = new char[len];</span>
-<span class="fc" id="L379"> Arrays.fill(padding, ' ');</span>
-<span class="fc" id="L380"> return new String(padding);</span>
+<span class="nc" id="L528"> final char[] padding = new char[len];</span>
+<span class="nc" id="L529"> Arrays.fill(padding, ' ');</span>
+<span class="nc" id="L530"> return new String(padding);</span>
+ }
+
+ private int determineMaxSinceLength(final Options options) {
+<span class="nc" id="L534"> final int minLen =
HEADER_SINCE.length();</span>
+<span class="nc bnc" id="L535" title="All 2 branches missed."> final
int len = options.getOptions().stream().map(o -> o.getSince() == null ?
minLen : o.getSince().length()).max(Integer::compareTo).orElse(minLen);</span>
+<span class="nc bnc" id="L536" title="All 2 branches missed."> return
len < minLen ? minLen : len;</span>
}
/**
@@ -392,32 +548,31 @@ public class HelpFormatter {
*/
protected int findWrapPos(final String text, final int width, final int
startPos) {
// the line ends before the max wrap pos or a new line char found
-<span class="fc" id="L395"> int pos = text.indexOf(Char.LF,
startPos);</span>
-<span class="fc bfc" id="L396" title="All 4 branches covered."> if (pos
!= -1 && pos <= width) {</span>
-<span class="fc" id="L397"> return pos + 1;</span>
- }
-<span class="fc" id="L399"> pos = text.indexOf(Char.TAB,
startPos);</span>
-<span class="pc bpc" id="L400" title="1 of 4 branches missed."> if (pos
!= -1 && pos <= width) {</span>
-<span class="fc" id="L401"> return pos + 1;</span>
+<span class="nc" id="L551"> int pos = text.indexOf(Char.LF,
startPos);</span>
+<span class="nc bnc" id="L552" title="All 4 branches missed."> if (pos
!= -1 && pos <= width) {</span>
+<span class="nc" id="L553"> return pos + 1;</span>
+ }
+<span class="nc" id="L555"> pos = text.indexOf(Char.TAB,
startPos);</span>
+<span class="nc bnc" id="L556" title="All 4 branches missed."> if (pos
!= -1 && pos <= width) {</span>
+<span class="nc" id="L557"> return pos + 1;</span>
}
-<span class="fc bfc" id="L403" title="All 2 branches covered."> if
(startPos + width >= text.length()) {</span>
-<span class="fc" id="L404"> return -1;</span>
+<span class="nc bnc" id="L559" title="All 2 branches missed."> if
(startPos + width >= text.length()) {</span>
+<span class="nc" id="L560"> return -1;</span>
}
// look for the last whitespace character before startPos+width
-<span class="fc bfc" id="L407" title="All 2 branches covered."> for
(pos = startPos + width; pos >= startPos; --pos) {</span>
-<span class="fc" id="L408"> final char c = text.charAt(pos);</span>
-<span class="pc bpc" id="L409" title="2 of 6 branches missed."> if
(c == Char.SP || c == Char.LF || c == Char.CR) {</span>
-<span class="nc" id="L410"> break;</span>
+<span class="nc bnc" id="L563" title="All 2 branches missed."> for (pos
= startPos + width; pos >= startPos; --pos) {</span>
+<span class="nc" id="L564"> final char c = text.charAt(pos);</span>
+<span class="nc bnc" id="L565" title="All 6 branches missed."> if
(c == Char.SP || c == Char.LF || c == Char.CR) {</span>
+<span class="nc" id="L566"> break;</span>
}
}
// if we found it - just return
-<span class="fc bfc" id="L414" title="All 2 branches covered."> if (pos
> startPos) {</span>
-<span class="fc" id="L415"> return pos;</span>
+<span class="nc bnc" id="L570" title="All 2 branches missed."> if (pos
> startPos) {</span>
+<span class="nc" id="L571"> return pos;</span>
}
// if we didn't find one, simply chop at startPos+width
-<span class="fc" id="L418"> pos = startPos + width;</span>
-
-<span class="pc bpc" id="L420" title="1 of 2 branches missed."> return
pos == text.length() ? -1 : pos;</span>
+<span class="nc" id="L574"> pos = startPos + width;</span>
+<span class="nc bnc" id="L575" title="All 2 branches missed."> return
pos == text.length() ? -1 : pos;</span>
}
/**
@@ -426,7 +581,7 @@ public class HelpFormatter {
* @return the 'argName'
*/
public String getArgName() {
-<span class="fc" id="L429"> return defaultArgName;</span>
+<span class="nc" id="L584"> return defaultArgName;</span>
}
/**
@@ -435,7 +590,7 @@ public class HelpFormatter {
* @return the 'descPadding'
*/
public int getDescPadding() {
-<span class="fc" id="L438"> return defaultDescPad;</span>
+<span class="nc" id="L593"> return defaultDescPad;</span>
}
/**
@@ -444,7 +599,7 @@ public class HelpFormatter {
* @return the 'leftPadding'
*/
public int getLeftPadding() {
-<span class="fc" id="L447"> return defaultLeftPad;</span>
+<span class="nc" id="L602"> return defaultLeftPad;</span>
}
/**
@@ -453,7 +608,7 @@ public class HelpFormatter {
* @return the 'longOptPrefix'
*/
public String getLongOptPrefix() {
-<span class="fc" id="L456"> return defaultLongOptPrefix;</span>
+<span class="nc" id="L611"> return defaultLongOptPrefix;</span>
}
/**
@@ -463,7 +618,7 @@ public class HelpFormatter {
* @since 1.3
*/
public String getLongOptSeparator() {
-<span class="fc" id="L466"> return longOptSeparator;</span>
+<span class="nc" id="L621"> return longOptSeparator;</span>
}
/**
@@ -472,7 +627,7 @@ public class HelpFormatter {
* @return the 'newLine'
*/
public String getNewLine() {
-<span class="fc" id="L475"> return defaultNewLine;</span>
+<span class="nc" id="L630"> return defaultNewLine;</span>
}
/**
@@ -483,7 +638,7 @@ public class HelpFormatter {
* @since 1.2
*/
public Comparator<Option> getOptionComparator() {
-<span class="fc" id="L486"> return optionComparator;</span>
+<span class="nc" id="L641"> return optionComparator;</span>
}
/**
@@ -492,7 +647,7 @@ public class HelpFormatter {
* @return the 'optPrefix'
*/
public String getOptPrefix() {
-<span class="fc" id="L495"> return defaultOptPrefix;</span>
+<span class="nc" id="L650"> return defaultOptPrefix;</span>
}
/**
@@ -501,7 +656,7 @@ public class HelpFormatter {
* @return the 'syntaxPrefix'
*/
public String getSyntaxPrefix() {
-<span class="fc" id="L504"> return defaultSyntaxPrefix;</span>
+<span class="nc" id="L659"> return defaultSyntaxPrefix;</span>
}
/**
@@ -510,7 +665,7 @@ public class HelpFormatter {
* @return the 'width'
*/
public int getWidth() {
-<span class="fc" id="L513"> return defaultWidth;</span>
+<span class="nc" id="L668"> return defaultWidth;</span>
}
/**
@@ -524,8 +679,8 @@ public class HelpFormatter {
* @param footer the banner to display at the end of the help
*/
public void printHelp(final int width, final String cmdLineSyntax, final
String header, final Options options, final String footer) {
-<span class="fc" id="L527"> printHelp(width, cmdLineSyntax, header,
options, footer, false);</span>
-<span class="fc" id="L528"> }</span>
+<span class="nc" id="L682"> printHelp(width, cmdLineSyntax, header,
options, footer, false);</span>
+<span class="nc" id="L683"> }</span>
/**
* Prints the help for {@code options} with the specified command line
syntax. This method prints help information
@@ -540,10 +695,10 @@ public class HelpFormatter {
*/
public void printHelp(final int width, final String cmdLineSyntax, final
String header, final Options options, final String footer,
final boolean autoUsage) {
-<span class="fc" id="L543"> final PrintWriter pw = new
PrintWriter(printWriter);</span>
-<span class="fc" id="L544"> printHelp(pw, width, cmdLineSyntax, header,
options, getLeftPadding(), getDescPadding(), footer, autoUsage);</span>
-<span class="fc" id="L545"> pw.flush();</span>
-<span class="fc" id="L546"> }</span>
+<span class="nc" id="L698"> final PrintWriter pw = new
PrintWriter(printWriter);</span>
+<span class="nc" id="L699"> printHelp(pw, width, cmdLineSyntax, header,
options, getLeftPadding(), getDescPadding(), footer, autoUsage);</span>
+<span class="nc" id="L700"> pw.flush();</span>
+<span class="nc" id="L701"> }</span>
/**
* Prints the help for {@code options} with the specified command line
syntax.
@@ -561,8 +716,8 @@ public class HelpFormatter {
*/
public void printHelp(final PrintWriter pw, final int width, final String
cmdLineSyntax, final String header, final Options options, final int leftPad,
final int descPad, final String footer) {
-<span class="fc" id="L564"> printHelp(pw, width, cmdLineSyntax, header,
options, leftPad, descPad, footer, false);</span>
-<span class="fc" id="L565"> }</span>
+<span class="nc" id="L719"> printHelp(pw, width, cmdLineSyntax, header,
options, leftPad, descPad, footer, false);</span>
+<span class="nc" id="L720"> }</span>
/**
* Prints the help for {@code options} with the specified command line
syntax.
@@ -580,22 +735,22 @@ public class HelpFormatter {
*/
public void printHelp(final PrintWriter pw, final int width, final String
cmdLineSyntax, final String header, final Options options, final int leftPad,
final int descPad, final String footer, final boolean autoUsage) {
-<span class="fc bfc" id="L583" title="All 2 branches covered."> if
(Util.isEmpty(cmdLineSyntax)) {</span>
-<span class="fc" id="L584"> throw new
IllegalArgumentException("cmdLineSyntax not provided");</span>
+<span class="nc bnc" id="L738" title="All 2 branches missed."> if
(Util.isEmpty(cmdLineSyntax)) {</span>
+<span class="nc" id="L739"> throw new
IllegalArgumentException("cmdLineSyntax not provided");</span>
}
-<span class="fc bfc" id="L586" title="All 2 branches covered."> if
(autoUsage) {</span>
-<span class="fc" id="L587"> printUsage(pw, width, cmdLineSyntax,
options);</span>
- } else {
-<span class="fc" id="L589"> printUsage(pw, width,
cmdLineSyntax);</span>
- }
-<span class="fc bfc" id="L591" title="All 4 branches covered."> if
(header != null && !header.isEmpty()) {</span>
-<span class="fc" id="L592"> printWrapped(pw, width, header);</span>
- }
-<span class="fc" id="L594"> printOptions(pw, width, options, leftPad,
descPad);</span>
-<span class="fc bfc" id="L595" title="All 4 branches covered."> if
(footer != null && !footer.isEmpty()) {</span>
-<span class="fc" id="L596"> printWrapped(pw, width, footer);</span>
+<span class="nc bnc" id="L741" title="All 2 branches missed."> if
(autoUsage) {</span>
+<span class="nc" id="L742"> printUsage(pw, width, cmdLineSyntax,
options);</span>
+<span class="nc" id="L743"> } else {</span>
+<span class="nc" id="L744"> printUsage(pw, width,
cmdLineSyntax);</span>
+ }
+<span class="nc bnc" id="L746" title="All 4 branches missed."> if
(header != null && !header.isEmpty()) {</span>
+<span class="nc" id="L747"> printWrapped(pw, width, header);</span>
+ }
+<span class="nc" id="L749"> printOptions(pw, width, options, leftPad,
descPad);</span>
+<span class="nc bnc" id="L750" title="All 4 branches missed."> if
(footer != null && !footer.isEmpty()) {</span>
+<span class="nc" id="L751"> printWrapped(pw, width, footer);</span>
}
-<span class="fc" id="L598"> }</span>
+<span class="nc" id="L753"> }</span>
/**
* Prints the help for {@code options} with the specified command line
syntax. This method prints help information
@@ -605,8 +760,8 @@ public class HelpFormatter {
* @param options the Options instance
*/
public void printHelp(final String cmdLineSyntax, final Options options) {
-<span class="fc" id="L608"> printHelp(getWidth(), cmdLineSyntax, null,
options, null, false);</span>
-<span class="fc" id="L609"> }</span>
+<span class="nc" id="L763"> printHelp(getWidth(), cmdLineSyntax, null,
options, null, false);</span>
+<span class="nc" id="L764"> }</span>
/**
* Prints the help for {@code options} with the specified command line
syntax. This method prints help information
@@ -617,8 +772,8 @@ public class HelpFormatter {
* @param autoUsage whether to print an automatically generated usage
statement
*/
public void printHelp(final String cmdLineSyntax, final Options options,
final boolean autoUsage) {
-<span class="fc" id="L620"> printHelp(getWidth(), cmdLineSyntax, null,
options, null, autoUsage);</span>
-<span class="fc" id="L621"> }</span>
+<span class="nc" id="L775"> printHelp(getWidth(), cmdLineSyntax, null,
options, null, autoUsage);</span>
+<span class="nc" id="L776"> }</span>
/**
* Prints the help for {@code options} with the specified command line
syntax. This method prints help information
@@ -630,8 +785,8 @@ public class HelpFormatter {
* @param footer the banner to display at the end of the help
*/
public void printHelp(final String cmdLineSyntax, final String header,
final Options options, final String footer) {
-<span class="fc" id="L633"> printHelp(cmdLineSyntax, header, options,
footer, false);</span>
-<span class="fc" id="L634"> }</span>
+<span class="nc" id="L788"> printHelp(cmdLineSyntax, header, options,
footer, false);</span>
+<span class="nc" id="L789"> }</span>
/**
* Prints the help for {@code options} with the specified command line
syntax. This method prints help information
@@ -644,8 +799,8 @@ public class HelpFormatter {
* @param autoUsage whether to print an automatically generated usage
statement
*/
public void printHelp(final String cmdLineSyntax, final String header,
final Options options, final String footer, final boolean autoUsage) {
-<span class="fc" id="L647"> printHelp(getWidth(), cmdLineSyntax,
header, options, footer, autoUsage);</span>
-<span class="fc" id="L648"> }</span>
+<span class="nc" id="L802"> printHelp(getWidth(), cmdLineSyntax,
header, options, footer, autoUsage);</span>
+<span class="nc" id="L803"> }</span>
/**
* Prints the help for the specified Options to the specified writer,
using the specified width, left padding and
@@ -658,10 +813,13 @@ public class HelpFormatter {
* @param descPad the number of characters of padding to be prefixed to
each description line
*/
public void printOptions(final PrintWriter pw, final int width, final
Options options, final int leftPad, final int descPad) {
-<span class="fc" id="L661"> final StringBuffer sb = new
StringBuffer();</span>
-<span class="fc" id="L662"> renderOptions(sb, width, options, leftPad,
descPad);</span>
-<span class="fc" id="L663"> pw.println(sb.toString());</span>
-<span class="fc" id="L664"> }</span>
+ try {
+<span class="nc" id="L817"> pw.println(appendOptions(new
StringBuilder(), width, options, leftPad, descPad));</span>
+<span class="nc" id="L818"> } catch (final IOException e) {</span>
+ // Cannot happen
+<span class="nc" id="L820"> throw new
UncheckedIOException(e);</span>
+ }
+<span class="nc" id="L822"> }</span>
/**
* Prints the cmdLineSyntax to the specified writer, using the specified
width.
@@ -671,9 +829,9 @@ public class HelpFormatter {
* @param cmdLineSyntax The usage statement.
*/
public void printUsage(final PrintWriter pw, final int width, final String
cmdLineSyntax) {
-<span class="fc" id="L674"> final int argPos = cmdLineSyntax.indexOf('
') + 1;</span>
-<span class="fc" id="L675"> printWrapped(pw, width,
getSyntaxPrefix().length() + argPos, getSyntaxPrefix() + cmdLineSyntax);</span>
-<span class="fc" id="L676"> }</span>
+<span class="nc" id="L832"> final int argPos = cmdLineSyntax.indexOf('
') + 1;</span>
+<span class="nc" id="L833"> printWrapped(pw, width,
getSyntaxPrefix().length() + argPos, getSyntaxPrefix() + cmdLineSyntax);</span>
+<span class="nc" id="L834"> }</span>
/**
* Prints the usage statement for the specified application.
@@ -685,43 +843,43 @@ public class HelpFormatter {
*/
public void printUsage(final PrintWriter pw, final int width, final String
app, final Options options) {
// initialize the string buffer
-<span class="fc" id="L688"> final StringBuffer buff = new
StringBuffer(getSyntaxPrefix()).append(app).append(Char.SP);</span>
+<span class="nc" id="L846"> final StringBuilder buff = new
StringBuilder(getSyntaxPrefix()).append(app).append(Char.SP);</span>
// create a list for processed option groups
-<span class="fc" id="L690"> final Collection<OptionGroup>
processedGroups = new ArrayList<>();</span>
-<span class="fc" id="L691"> final List<Option> optList = new
ArrayList<>(options.getOptions());</span>
-<span class="fc bfc" id="L692" title="All 2 branches covered."> if
(getOptionComparator() != null) {</span>
-<span class="fc" id="L693"> Collections.sort(optList,
getOptionComparator());</span>
+<span class="nc" id="L848"> final Collection<OptionGroup>
processedGroups = new ArrayList<>();</span>
+<span class="nc" id="L849"> final List<Option> optList = new
ArrayList<>(options.getOptions());</span>
+<span class="nc bnc" id="L850" title="All 2 branches missed."> if
(getOptionComparator() != null) {</span>
+<span class="nc" id="L851"> Collections.sort(optList,
getOptionComparator());</span>
}
// iterate over the options
-<span class="fc bfc" id="L696" title="All 2 branches covered."> for
(final Iterator<Option> it = optList.iterator(); it.hasNext();) {</span>
+<span class="nc bnc" id="L854" title="All 2 branches missed."> for
(final Iterator<Option> it = optList.iterator(); it.hasNext();) {</span>
// get the next Option
-<span class="fc" id="L698"> final Option option = it.next();</span>
+<span class="nc" id="L856"> final Option option = it.next();</span>
// check if the option is part of an OptionGroup
-<span class="fc" id="L700"> final OptionGroup group =
options.getOptionGroup(option);</span>
+<span class="nc" id="L858"> final OptionGroup group =
options.getOptionGroup(option);</span>
// if the option is part of a group
-<span class="fc bfc" id="L702" title="All 2 branches covered."> if
(group != null) {</span>
+<span class="nc bnc" id="L860" title="All 2 branches missed."> if
(group != null) {</span>
// and if the group has not already been processed
-<span class="fc bfc" id="L704" title="All 2 branches covered.">
if (!processedGroups.contains(group)) {</span>
+<span class="nc bnc" id="L862" title="All 2 branches missed.">
if (!processedGroups.contains(group)) {</span>
// add the group to the processed list
-<span class="fc" id="L706">
processedGroups.add(group);</span>
+<span class="nc" id="L864">
processedGroups.add(group);</span>
// add the usage clause
-<span class="fc" id="L708"> appendOptionGroup(buff,
group);</span>
+<span class="nc" id="L866"> appendOptionGroup(buff,
group);</span>
}
// otherwise the option was displayed in the group
// previously so ignore it.
- }
+<span class="nc" id="L870"> }</span>
// if the Option is not part of an OptionGroup
else {
-<span class="fc" id="L715"> appendOption(buff, option,
option.isRequired());</span>
+<span class="nc" id="L873"> appendOption(buff, option,
option.isRequired());</span>
}
-<span class="fc bfc" id="L717" title="All 2 branches covered."> if
(it.hasNext()) {</span>
-<span class="fc" id="L718"> buff.append(Char.SP);</span>
+<span class="nc bnc" id="L875" title="All 2 branches missed."> if
(it.hasNext()) {</span>
+<span class="nc" id="L876"> buff.append(Char.SP);</span>
}
-<span class="fc" id="L720"> }</span>
+ }
// call printWrapped
-<span class="fc" id="L723"> printWrapped(pw, width,
buff.toString().indexOf(' ') + 1, buff.toString());</span>
-<span class="fc" id="L724"> }</span>
+<span class="nc" id="L881"> printWrapped(pw, width,
buff.toString().indexOf(' ') + 1, buff.toString());</span>
+<span class="nc" id="L882"> }</span>
/**
* Prints the specified text to the specified PrintWriter.
@@ -732,10 +890,8 @@ public class HelpFormatter {
* @param text The text to be written to the PrintWriter
*/
public void printWrapped(final PrintWriter pw, final int width, final int
nextLineTabStop, final String text) {
-<span class="fc" id="L735"> final StringBuffer sb = new
StringBuffer(text.length());</span>
-<span class="fc" id="L736"> renderWrappedTextBlock(sb, width,
nextLineTabStop, text);</span>
-<span class="fc" id="L737"> pw.println(sb.toString());</span>
-<span class="fc" id="L738"> }</span>
+<span class="nc" id="L893"> pw.println(renderWrappedTextBlock(new
StringBuilder(text.length()), width, nextLineTabStop, text));</span>
+<span class="nc" id="L894"> }</span>
/**
* Prints the specified text to the specified PrintWriter.
@@ -745,8 +901,8 @@ public class HelpFormatter {
* @param text The text to be written to the PrintWriter
*/
public void printWrapped(final PrintWriter pw, final int width, final
String text) {
-<span class="fc" id="L748"> printWrapped(pw, width, 0, text);</span>
-<span class="fc" id="L749"> }</span>
+<span class="nc" id="L904"> printWrapped(pw, width, 0, text);</span>
+<span class="nc" id="L905"> }</span>
/**
* Renders the specified Options and return the rendered Options in a
StringBuffer.
@@ -760,61 +916,12 @@ public class HelpFormatter {
* @return the StringBuffer with the rendered Options contents.
*/
protected StringBuffer renderOptions(final StringBuffer sb, final int
width, final Options options, final int leftPad, final int descPad) {
-<span class="fc" id="L763"> final String lpad =
createPadding(leftPad);</span>
-<span class="fc" id="L764"> final String dpad =
createPadding(descPad);</span>
- // first create list containing only <lpad>-a,--aaa where
- // -a is opt and --aaa is long opt; in parallel look for
- // the longest opt string this list will be then used to
- // sort options ascending
-<span class="fc" id="L769"> int max = 0;</span>
-<span class="fc" id="L770"> final List<StringBuffer> prefixList =
new ArrayList<>();</span>
-<span class="fc" id="L771"> final List<Option> optList =
options.helpOptions();</span>
-<span class="pc bpc" id="L772" title="1 of 2 branches missed."> if
(getOptionComparator() != null) {</span>
-<span class="fc" id="L773"> Collections.sort(optList,
getOptionComparator());</span>
- }
-<span class="fc bfc" id="L775" title="All 2 branches covered."> for
(final Option option : optList) {</span>
-<span class="fc" id="L776"> final StringBuffer optBuf = new
StringBuffer();</span>
-<span class="fc bfc" id="L777" title="All 2 branches covered."> if
(option.getOpt() == null) {</span>
-<span class="fc" id="L778"> optBuf.append(lpad).append("
").append(getLongOptPrefix()).append(option.getLongOpt());</span>
- } else {
-<span class="fc" id="L780">
optBuf.append(lpad).append(getOptPrefix()).append(option.getOpt());</span>
-<span class="fc bfc" id="L781" title="All 2 branches covered.">
if (option.hasLongOpt()) {</span>
-<span class="fc" id="L782">
optBuf.append(',').append(getLongOptPrefix()).append(option.getLongOpt());</span>
- }
- }
-<span class="fc bfc" id="L785" title="All 2 branches covered."> if
(option.hasArg()) {</span>
-<span class="fc" id="L786"> final String argName =
option.getArgName();</span>
-<span class="pc bpc" id="L787" title="1 of 4 branches missed.">
if (argName != null && argName.isEmpty()) {</span>
- // if the option has a blank argname
-<span class="nc" id="L789"> optBuf.append(' ');</span>
- } else {
-<span class="fc bfc" id="L791" title="All 2 branches covered.">
optBuf.append(option.hasLongOpt() ? longOptSeparator : "
");</span>
-<span class="fc bfc" id="L792" title="All 2 branches covered.">
optBuf.append("<").append(argName != null ?
option.getArgName() : getArgName()).append(">");</span>
- }
- }
-<span class="fc" id="L795"> prefixList.add(optBuf);</span>
-<span class="fc" id="L796"> max = Math.max(optBuf.length(),
max);</span>
-<span class="fc" id="L797"> }</span>
-<span class="fc" id="L798"> int x = 0;</span>
-<span class="fc bfc" id="L799" title="All 2 branches covered."> for
(final Iterator<Option> it = optList.iterator(); it.hasNext();) {</span>
-<span class="fc" id="L800"> final Option option = it.next();</span>
-<span class="fc" id="L801"> final StringBuilder optBuf = new
StringBuilder(prefixList.get(x++).toString());</span>
-<span class="fc bfc" id="L802" title="All 2 branches covered."> if
(optBuf.length() < max) {</span>
-<span class="fc" id="L803"> optBuf.append(createPadding(max -
optBuf.length()));</span>
- }
-<span class="fc" id="L805"> optBuf.append(dpad);</span>
-<span class="fc" id="L806"> final int nextLineTabStop = max +
descPad;</span>
-<span class="fc bfc" id="L807" title="All 4 branches covered."> if
(deprecatedFormatFunc != null && option.isDeprecated()) {</span>
-<span class="fc" id="L808">
optBuf.append(deprecatedFormatFunc.apply(option).trim());</span>
-<span class="fc bfc" id="L809" title="All 2 branches covered."> }
else if (option.getDescription() != null) {</span>
-<span class="fc" id="L810">
optBuf.append(option.getDescription());</span>
- }
-<span class="fc" id="L812"> renderWrappedText(sb, width,
nextLineTabStop, optBuf.toString());</span>
-<span class="fc bfc" id="L813" title="All 2 branches covered."> if
(it.hasNext()) {</span>
-<span class="fc" id="L814"> sb.append(getNewLine());</span>
- }
-<span class="fc" id="L816"> }</span>
-<span class="fc" id="L817"> return sb;</span>
+ try {
+<span class="nc" id="L920"> return appendOptions(sb, width,
options, leftPad, descPad);</span>
+<span class="nc" id="L921"> } catch (final IOException e) {</span>
+ // Cannot happen
+<span class="nc" id="L923"> throw new
UncheckedIOException(e);</span>
+ }
}
/**
@@ -828,31 +935,11 @@ public class HelpFormatter {
* @return the StringBuffer with the rendered Options contents.
*/
protected StringBuffer renderWrappedText(final StringBuffer sb, final int
width, final int nextLineTabStop, final String text) {
-<span class="fc" id="L831"> String render = text;</span>
-<span class="fc" id="L832"> int nextLineTabStopPos =
nextLineTabStop;</span>
-<span class="fc" id="L833"> int pos = findWrapPos(render, width,
0);</span>
-<span class="fc bfc" id="L834" title="All 2 branches covered."> if (pos
== -1) {</span>
-<span class="fc" id="L835"> sb.append(rtrim(render));</span>
-<span class="fc" id="L836"> return sb;</span>
- }
-<span class="fc" id="L838"> sb.append(rtrim(render.substring(0,
pos))).append(getNewLine());</span>
-<span class="fc bfc" id="L839" title="All 2 branches covered."> if
(nextLineTabStopPos >= width) {</span>
- // stops infinite loop happening
-<span class="fc" id="L841"> nextLineTabStopPos = 1;</span>
- }
- // all following lines must be padded with nextLineTabStop space
characters
-<span class="fc" id="L844"> final String padding =
createPadding(nextLineTabStopPos);</span>
- while (true) {
-<span class="fc" id="L846"> render = padding +
render.substring(pos).trim();</span>
-<span class="fc" id="L847"> pos = findWrapPos(render, width,
0);</span>
-<span class="fc bfc" id="L848" title="All 2 branches covered."> if
(pos == -1) {</span>
-<span class="fc" id="L849"> sb.append(render);</span>
-<span class="fc" id="L850"> return sb;</span>
- }
-<span class="fc bfc" id="L852" title="All 4 branches covered."> if
(render.length() > width && pos == nextLineTabStopPos - 1) {</span>
-<span class="fc" id="L853"> pos = width;</span>
- }
-<span class="fc" id="L855"> sb.append(rtrim(render.substring(0,
pos))).append(getNewLine());</span>
+ try {
+<span class="nc" id="L939"> return appendWrappedText(sb, width,
nextLineTabStop, text);</span>
+<span class="nc" id="L940"> } catch (final IOException e) {</span>
+ // Cannot happen.
+<span class="nc" id="L942"> throw new
UncheckedIOException(e);</span>
}
}
@@ -860,28 +947,28 @@ public class HelpFormatter {
* Renders the specified text width a maximum width. This method differs
from renderWrappedText by not removing leading
* spaces after a new line.
*
- * @param sb The StringBuffer to place the rendered text into.
+ * @param appendable The StringBuffer to place the rendered text into.
* @param width The number of characters to display per line
* @param nextLineTabStop The position on the next line for the first tab.
* @param text The text to be rendered.
*/
- private Appendable renderWrappedTextBlock(final StringBuffer sb, final int
width, final int nextLineTabStop, final String text) {
+ private <A extends Appendable> A renderWrappedTextBlock(final A
appendable, final int width, final int nextLineTabStop, final String text) {
try {
-<span class="fc" id="L870"> final BufferedReader in = new
BufferedReader(new StringReader(text));</span>
+<span class="nc" id="L957"> final BufferedReader in = new
BufferedReader(new StringReader(text));</span>
String line;
-<span class="fc" id="L872"> boolean firstLine = true;</span>
-<span class="fc bfc" id="L873" title="All 2 branches covered.">
while ((line = in.readLine()) != null) {</span>
-<span class="fc bfc" id="L874" title="All 2 branches covered.">
if (!firstLine) {</span>
-<span class="fc" id="L875"> sb.append(getNewLine());</span>
- } else {
-<span class="fc" id="L877"> firstLine = false;</span>
+<span class="nc" id="L959"> boolean firstLine = true;</span>
+<span class="nc bnc" id="L960" title="All 2 branches missed.">
while ((line = in.readLine()) != null) {</span>
+<span class="nc bnc" id="L961" title="All 2 branches missed.">
if (!firstLine) {</span>
+<span class="nc" id="L962">
appendable.append(getNewLine());</span>
+<span class="nc" id="L963"> } else {</span>
+<span class="nc" id="L964"> firstLine = false;</span>
}
-<span class="fc" id="L879"> renderWrappedText(sb, width,
nextLineTabStop, line);</span>
+<span class="nc" id="L966"> appendWrappedText(appendable,
width, nextLineTabStop, line);</span>
}
-<span class="nc" id="L881"> } catch (final IOException e) { //
NOPMD</span>
+<span class="nc" id="L968"> } catch (final IOException e) { //
NOPMD</span>
// cannot happen
-<span class="fc" id="L883"> }</span>
-<span class="fc" id="L884"> return sb;</span>
+ }
+<span class="nc" id="L971"> return appendable;</span>
}
/**
@@ -891,14 +978,14 @@ public class HelpFormatter {
* @return The String of without the trailing padding
*/
protected String rtrim(final String s) {
-<span class="fc bfc" id="L894" title="All 2 branches covered."> if
(Util.isEmpty(s)) {</span>
-<span class="fc" id="L895"> return s;</span>
+<span class="nc bnc" id="L981" title="All 2 branches missed."> if
(Util.isEmpty(s)) {</span>
+<span class="nc" id="L982"> return s;</span>
}
-<span class="fc" id="L897"> int pos = s.length();</span>
-<span class="pc bpc" id="L898" title="1 of 4 branches missed."> while
(pos > 0 && Character.isWhitespace(s.charAt(pos - 1))) {</span>
-<span class="fc" id="L899"> --pos;</span>
+<span class="nc" id="L984"> int pos = s.length();</span>
+<span class="nc bnc" id="L985" title="All 4 branches missed."> while
(pos > 0 && Character.isWhitespace(s.charAt(pos - 1))) {</span>
+<span class="nc" id="L986"> --pos;</span>
}
-<span class="fc" id="L901"> return s.substring(0, pos);</span>
+<span class="nc" id="L988"> return s.substring(0, pos);</span>
}
/**
@@ -907,8 +994,8 @@ public class HelpFormatter {
* @param name the new value of 'argName'
*/
public void setArgName(final String name) {
-<span class="fc" id="L910"> this.defaultArgName = name;</span>
-<span class="fc" id="L911"> }</span>
+<span class="nc" id="L997"> this.defaultArgName = name;</span>
+<span class="nc" id="L998"> }</span>
/**
* Sets the 'descPadding'.
@@ -916,8 +1003,8 @@ public class HelpFormatter {
* @param padding the new value of 'descPadding'
*/
public void setDescPadding(final int padding) {
-<span class="fc" id="L919"> this.defaultDescPad = padding;</span>
-<span class="fc" id="L920"> }</span>
+<span class="nc" id="L1006"> this.defaultDescPad = padding;</span>
+<span class="nc" id="L1007"> }</span>
/**
* Sets the 'leftPadding'.
@@ -925,8 +1012,8 @@ public class HelpFormatter {
* @param padding the new value of 'leftPadding'
*/
public void setLeftPadding(final int padding) {
-<span class="fc" id="L928"> this.defaultLeftPad = padding;</span>
-<span class="fc" id="L929"> }</span>
+<span class="nc" id="L1015"> this.defaultLeftPad = padding;</span>
+<span class="nc" id="L1016"> }</span>
/**
* Sets the 'longOptPrefix'.
@@ -934,8 +1021,8 @@ public class HelpFormatter {
* @param prefix the new value of 'longOptPrefix'
*/
public void setLongOptPrefix(final String prefix) {
-<span class="fc" id="L937"> this.defaultLongOptPrefix = prefix;</span>
-<span class="fc" id="L938"> }</span>
+<span class="nc" id="L1024"> this.defaultLongOptPrefix = prefix;</span>
+<span class="nc" id="L1025"> }</span>
/**
* Sets the separator displayed between a long option and its value.
Ensure that the separator specified is supported by
@@ -945,8 +1032,8 @@ public class HelpFormatter {
* @since 1.3
*/
public void setLongOptSeparator(final String longOptSeparator) {
-<span class="fc" id="L948"> this.longOptSeparator =
longOptSeparator;</span>
-<span class="fc" id="L949"> }</span>
+<span class="nc" id="L1035"> this.longOptSeparator =
longOptSeparator;</span>
+<span class="nc" id="L1036"> }</span>
/**
* Sets the 'newLine'.
@@ -954,8 +1041,8 @@ public class HelpFormatter {
* @param newline the new value of 'newLine'
*/
public void setNewLine(final String newline) {
-<span class="fc" id="L957"> this.defaultNewLine = newline;</span>
-<span class="fc" id="L958"> }</span>
+<span class="nc" id="L1044"> this.defaultNewLine = newline;</span>
+<span class="nc" id="L1045"> }</span>
/**
* Sets the comparator used to sort the options when they output in help
text. Passing in a null comparator will keep the
@@ -965,8 +1052,8 @@ public class HelpFormatter {
* @since 1.2
*/
public void setOptionComparator(final Comparator<Option> comparator)
{
-<span class="fc" id="L968"> this.optionComparator = comparator;</span>
-<span class="fc" id="L969"> }</span>
+<span class="nc" id="L1055"> this.optionComparator = comparator;</span>
+<span class="nc" id="L1056"> }</span>
/**
* Sets the 'optPrefix'.
@@ -974,8 +1061,8 @@ public class HelpFormatter {
* @param prefix the new value of 'optPrefix'
*/
public void setOptPrefix(final String prefix) {
-<span class="fc" id="L977"> this.defaultOptPrefix = prefix;</span>
-<span class="fc" id="L978"> }</span>
+<span class="nc" id="L1064"> this.defaultOptPrefix = prefix;</span>
+<span class="nc" id="L1065"> }</span>
/**
* Sets the 'syntaxPrefix'.
@@ -983,8 +1070,8 @@ public class HelpFormatter {
* @param prefix the new value of 'syntaxPrefix'
*/
public void setSyntaxPrefix(final String prefix) {
-<span class="fc" id="L986"> this.defaultSyntaxPrefix = prefix;</span>
-<span class="fc" id="L987"> }</span>
+<span class="nc" id="L1073"> this.defaultSyntaxPrefix = prefix;</span>
+<span class="nc" id="L1074"> }</span>
/**
* Sets the 'width'.
@@ -992,8 +1079,8 @@ public class HelpFormatter {
* @param width the new value of 'width'
*/
public void setWidth(final int width) {
-<span class="fc" id="L995"> this.defaultWidth = width;</span>
-<span class="fc" id="L996"> }</span>
+<span class="nc" id="L1082"> this.defaultWidth = width;</span>
+<span class="nc" id="L1083"> }</span>
}
</pre><div class="footer"><span class="right">Created with <a
href="http://www.jacoco.org/jacoco">JaCoCo</a>
0.8.12.202403310830</span></div></body></html>
\ No newline at end of file
Modified:
websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/MissingArgumentException.html
==============================================================================
---
websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/MissingArgumentException.html
(original)
+++
websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/MissingArgumentException.html
Thu Aug 15 00:03:23 2024
@@ -1 +1 @@
-<?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML
1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html
xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta
http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link
rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link
rel="shortcut icon" href="../jacoco-resources/report.gif"
type="image/gif"/><title>MissingArgumentException</title><script
type="text/javascript" src="../jacoco-resources/sort.js"></script></head><body
onload="initialSort(['breadcrumb'])"><div class="breadcrumb"
id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html"
class="el_session">Sessions</a></span><a href="../index.html"
class="el_report">Apache Commons CLI</a> > <a href="index.html"
class="el_package">org.apache.commons.cli</a> > <span
class="el_class">MissingArgumentException</span></div><h1>MissingArgumentException</h1><table
class="coverage" cellspacing
="0" id="coveragetable"><thead><tr><td class="sortable" id="a"
onclick="toggleSort(this)">Element</td><td class="down sortable bar" id="b"
onclick="toggleSort(this)">Missed Instructions</td><td class="sortable ctr2"
id="c" onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d"
onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" id="e"
onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f"
onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g"
onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h"
onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i"
onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j"
onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k"
onclick="toggleSort(this)">Methods</td></tr></thead><tfoot><tr><td>Total</td><td
class="bar">0 of 22</td><td class="ctr2">100%</td><td class="bar">0 of
0</td><td class="ctr2">n/a</td><td class="ctr1">0</td
><td class="ctr2">3</td><td class="ctr1">0</td><td class="ctr2">6</td><td
>class="ctr1">0</td><td class="ctr2">3</td></tr></tfoot><tbody><tr><td
>id="a1"><a href="MissingArgumentException.java.html#L39"
>class="el_method">MissingArgumentException(Option)</a></td><td class="bar"
>id="b0"><img src="../jacoco-resources/greenbar.gif" width="120" height="10"
>title="15" alt="15"/></td><td class="ctr2" id="c0">100%</td><td class="bar"
>id="d0"/><td class="ctr2" id="e0">n/a</td><td class="ctr1" id="f0">0</td><td
>class="ctr2" id="g0">1</td><td class="ctr1" id="h0">0</td><td class="ctr2"
>id="i0">3</td><td class="ctr1" id="j0">0</td><td class="ctr2"
>id="k0">1</td></tr><tr><td id="a2"><a
>href="MissingArgumentException.java.html#L49"
>class="el_method">MissingArgumentException(String)</a></td><td class="bar"
>id="b1"><img src="../jacoco-resources/greenbar.gif" width="32" height="10"
>title="4" alt="4"/></td><td class="ctr2" id="c1">100%</td><td class="bar"
>id="d1"/><td class="ctr2" id="e1">n/a</td><td c
lass="ctr1" id="f1">0</td><td class="ctr2" id="g1">1</td><td class="ctr1"
id="h1">0</td><td class="ctr2" id="i1">2</td><td class="ctr1" id="j1">0</td><td
class="ctr2" id="k1">1</td></tr><tr><td id="a0"><a
href="MissingArgumentException.java.html#L59"
class="el_method">getOption()</a></td><td class="bar" id="b2"><img
src="../jacoco-resources/greenbar.gif" width="24" height="10" title="3"
alt="3"/></td><td class="ctr2" id="c2">100%</td><td class="bar" id="d2"/><td
class="ctr2" id="e2">n/a</td><td class="ctr1" id="f2">0</td><td class="ctr2"
id="g2">1</td><td class="ctr1" id="h2">0</td><td class="ctr2" id="i2">1</td><td
class="ctr1" id="j2">0</td><td class="ctr2"
id="k2">1</td></tr></tbody></table><div class="footer"><span
class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a>
0.8.12.202403310830</span></div></body></html>
\ No newline at end of file
+<?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML
1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html
xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta
http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link
rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link
rel="shortcut icon" href="../jacoco-resources/report.gif"
type="image/gif"/><title>MissingArgumentException</title><script
type="text/javascript" src="../jacoco-resources/sort.js"></script></head><body
onload="initialSort(['breadcrumb'])"><div class="breadcrumb"
id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html"
class="el_session">Sessions</a></span><a href="../index.html"
class="el_report">Apache Commons CLI</a> > <a href="index.html"
class="el_package">org.apache.commons.cli</a> > <span
class="el_class">MissingArgumentException</span></div><h1>MissingArgumentException</h1><p>A
different version of class was
executed at runtime.</p><table class="coverage" cellspacing="0"
id="coveragetable"><thead><tr><td class="sortable" id="a"
onclick="toggleSort(this)">Element</td><td class="down sortable bar" id="b"
onclick="toggleSort(this)">Missed Instructions</td><td class="sortable ctr2"
id="c" onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d"
onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" id="e"
onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f"
onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g"
onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h"
onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i"
onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j"
onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k"
onclick="toggleSort(this)">Methods</td></tr></thead><tfoot><tr><td>Total</td><td
class="bar">21 of 21</td><td class="ctr2">0%</td><td class="bar"
>0 of 0</td><td class="ctr2">n/a</td><td class="ctr1">3</td><td
>class="ctr2">3</td><td class="ctr1">6</td><td class="ctr2">6</td><td
>class="ctr1">3</td><td class="ctr2">3</td></tr></tfoot><tbody><tr><td
>id="a1"><a href="MissingArgumentException.java.html#L39"
>class="el_method">MissingArgumentException(Option)</a></td><td class="bar"
>id="b0"><img src="../jacoco-resources/redbar.gif" width="120" height="10"
>title="14" alt="14"/></td><td class="ctr2" id="c0">0%</td><td class="bar"
>id="d0"/><td class="ctr2" id="e0">n/a</td><td class="ctr1" id="f0">1</td><td
>class="ctr2" id="g0">1</td><td class="ctr1" id="h0">3</td><td class="ctr2"
>id="i0">3</td><td class="ctr1" id="j0">1</td><td class="ctr2"
>id="k0">1</td></tr><tr><td id="a2"><a
>href="MissingArgumentException.java.html#L49"
>class="el_method">MissingArgumentException(String)</a></td><td class="bar"
>id="b1"><img src="../jacoco-resources/redbar.gif" width="34" height="10"
>title="4" alt="4"/></td><td class="ctr2" id="c1">0%</td><td class="b
ar" id="d1"/><td class="ctr2" id="e1">n/a</td><td class="ctr1"
id="f1">1</td><td class="ctr2" id="g1">1</td><td class="ctr1" id="h1">2</td><td
class="ctr2" id="i1">2</td><td class="ctr1" id="j1">1</td><td class="ctr2"
id="k1">1</td></tr><tr><td id="a0"><a
href="MissingArgumentException.java.html#L59"
class="el_method">getOption()</a></td><td class="bar" id="b2"><img
src="../jacoco-resources/redbar.gif" width="25" height="10" title="3"
alt="3"/></td><td class="ctr2" id="c2">0%</td><td class="bar" id="d2"/><td
class="ctr2" id="e2">n/a</td><td class="ctr1" id="f2">1</td><td class="ctr2"
id="g2">1</td><td class="ctr1" id="h2">1</td><td class="ctr2" id="i2">1</td><td
class="ctr1" id="j2">1</td><td class="ctr2"
id="k2">1</td></tr></tbody></table><div class="footer"><span
class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a>
0.8.12.202403310830</span></div></body></html>
\ No newline at end of file
Modified:
websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/MissingArgumentException.java.html
==============================================================================
---
websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/MissingArgumentException.java.html
(original)
+++
websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/MissingArgumentException.java.html
Thu Aug 15 00:03:23 2024
@@ -36,9 +36,9 @@ public class MissingArgumentException ex
* @since 1.2
*/
public MissingArgumentException(final Option option) {
-<span class="fc" id="L39"> this("Missing argument for option:
" + option.getKey());</span>
-<span class="fc" id="L40"> this.option = option;</span>
-<span class="fc" id="L41"> }</span>
+<span class="nc" id="L39"> this("Missing argument for option:
" + option.getKey());</span>
+<span class="nc" id="L40"> this.option = option;</span>
+<span class="nc" id="L41"> }</span>
/**
* Constructs a new {@code MissingArgumentException} with the specified
detail message.
@@ -46,8 +46,8 @@ public class MissingArgumentException ex
* @param message the detail message
*/
public MissingArgumentException(final String message) {
-<span class="fc" id="L49"> super(message);</span>
-<span class="fc" id="L50"> }</span>
+<span class="nc" id="L49"> super(message);</span>
+<span class="nc" id="L50"> }</span>
/**
* Gets the option requiring an argument that wasn't provided on the
command line.
@@ -56,7 +56,7 @@ public class MissingArgumentException ex
* @since 1.2
*/
public Option getOption() {
-<span class="fc" id="L59"> return option;</span>
+<span class="nc" id="L59"> return option;</span>
}
}
</pre><div class="footer"><span class="right">Created with <a
href="http://www.jacoco.org/jacoco">JaCoCo</a>
0.8.12.202403310830</span></div></body></html>
\ No newline at end of file
Modified:
websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/MissingOptionException.html
==============================================================================
---
websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/MissingOptionException.html
(original)
+++
websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/MissingOptionException.html
Thu Aug 15 00:03:23 2024
@@ -1 +1 @@
-<?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML
1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html
xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta
http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link
rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link
rel="shortcut icon" href="../jacoco-resources/report.gif"
type="image/gif"/><title>MissingOptionException</title><script
type="text/javascript" src="../jacoco-resources/sort.js"></script></head><body
onload="initialSort(['breadcrumb'])"><div class="breadcrumb"
id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html"
class="el_session">Sessions</a></span><a href="../index.html"
class="el_report">Apache Commons CLI</a> > <a href="index.html"
class="el_package">org.apache.commons.cli</a> > <span
class="el_class">MissingOptionException</span></div><h1>MissingOptionException</h1><table
class="coverage" cellspacing="0" i
d="coveragetable"><thead><tr><td class="sortable" id="a"
onclick="toggleSort(this)">Element</td><td class="down sortable bar" id="b"
onclick="toggleSort(this)">Missed Instructions</td><td class="sortable ctr2"
id="c" onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d"
onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" id="e"
onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f"
onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g"
onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h"
onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i"
onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j"
onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k"
onclick="toggleSort(this)">Methods</td></tr></thead><tfoot><tr><td>Total</td><td
class="bar">0 of 56</td><td class="ctr2">100%</td><td class="bar">0 of
6</td><td class="ctr2">100%</td><td class="ctr1">0</td><td
class="ctr2">7</td><td class="ctr1">0</td><td class="ctr2">15</td><td
class="ctr1">0</td><td class="ctr2">4</td></tr></tfoot><tbody><tr><td
id="a0"><a href="MissingOptionException.java.html#L36"
class="el_method">createMessage(List)</a></td><td class="bar" id="b0"><img
src="../jacoco-resources/greenbar.gif" width="120" height="10" title="41"
alt="41"/></td><td class="ctr2" id="c0">100%</td><td class="bar" id="d0"><img
src="../jacoco-resources/greenbar.gif" width="120" height="10" title="6"
alt="6"/></td><td class="ctr2" id="e0">100%</td><td class="ctr1"
id="f0">0</td><td class="ctr2" id="g0">4</td><td class="ctr1" id="h0">0</td><td
class="ctr2" id="i0">9</td><td class="ctr1" id="j0">0</td><td class="ctr2"
id="k0">1</td></tr><tr><td id="a2"><a
href="MissingOptionException.java.html#L61"
class="el_method">MissingOptionException(List)</a></td><td class="bar"
id="b1"><img src="../jacoco-resources/greenbar.gif" width="23" height="10"
title="8" alt="8"/></td><td class="ctr2" id="c1">100%<
/td><td class="bar" id="d1"/><td class="ctr2" id="e1">n/a</td><td class="ctr1"
id="f1">0</td><td class="ctr2" id="g1">1</td><td class="ctr1" id="h1">0</td><td
class="ctr2" id="i1">3</td><td class="ctr1" id="j1">0</td><td class="ctr2"
id="k1">1</td></tr><tr><td id="a3"><a
href="MissingOptionException.java.html#L71"
class="el_method">MissingOptionException(String)</a></td><td class="bar"
id="b2"><img src="../jacoco-resources/greenbar.gif" width="11" height="10"
title="4" alt="4"/></td><td class="ctr2" id="c2">100%</td><td class="bar"
id="d2"/><td class="ctr2" id="e2">n/a</td><td class="ctr1" id="f2">0</td><td
class="ctr2" id="g2">1</td><td class="ctr1" id="h2">0</td><td class="ctr2"
id="i2">2</td><td class="ctr1" id="j2">0</td><td class="ctr2"
id="k2">1</td></tr><tr><td id="a1"><a
href="MissingOptionException.java.html#L82"
class="el_method">getMissingOptions()</a></td><td class="bar" id="b3"><img
src="../jacoco-resources/greenbar.gif" width="8" height="10" title="3"
alt="3"/></td><td
class="ctr2" id="c3">100%</td><td class="bar" id="d3"/><td class="ctr2"
id="e3">n/a</td><td class="ctr1" id="f3">0</td><td class="ctr2"
id="g3">1</td><td class="ctr1" id="h3">0</td><td class="ctr2" id="i3">1</td><td
class="ctr1" id="j3">0</td><td class="ctr2"
id="k3">1</td></tr></tbody></table><div class="footer"><span
class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a>
0.8.12.202403310830</span></div></body></html>
\ No newline at end of file
+<?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML
1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html
xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta
http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link
rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link
rel="shortcut icon" href="../jacoco-resources/report.gif"
type="image/gif"/><title>MissingOptionException</title><script
type="text/javascript" src="../jacoco-resources/sort.js"></script></head><body
onload="initialSort(['breadcrumb'])"><div class="breadcrumb"
id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html"
class="el_session">Sessions</a></span><a href="../index.html"
class="el_report">Apache Commons CLI</a> > <a href="index.html"
class="el_package">org.apache.commons.cli</a> > <span
class="el_class">MissingOptionException</span></div><h1>MissingOptionException</h1><p>A
different version of class was execu
ted at runtime.</p><table class="coverage" cellspacing="0"
id="coveragetable"><thead><tr><td class="sortable" id="a"
onclick="toggleSort(this)">Element</td><td class="down sortable bar" id="b"
onclick="toggleSort(this)">Missed Instructions</td><td class="sortable ctr2"
id="c" onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d"
onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" id="e"
onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f"
onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g"
onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h"
onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i"
onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j"
onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k"
onclick="toggleSort(this)">Methods</td></tr></thead><tfoot><tr><td>Total</td><td
class="bar">56 of 56</td><td class="ctr2">0%</td><td class="bar">6 of
6</td><td class="ctr2">0%</td><td class="ctr1">7</td><td
class="ctr2">7</td><td class="ctr1">15</td><td class="ctr2">15</td><td
class="ctr1">4</td><td class="ctr2">4</td></tr></tfoot><tbody><tr><td
id="a0"><a href="MissingOptionException.java.html#L36"
class="el_method">createMessage(List)</a></td><td class="bar" id="b0"><img
src="../jacoco-resources/redbar.gif" width="120" height="10" title="41"
alt="41"/></td><td class="ctr2" id="c0">0%</td><td class="bar" id="d0"><img
src="../jacoco-resources/redbar.gif" width="120" height="10" title="6"
alt="6"/></td><td class="ctr2" id="e0">0%</td><td class="ctr1"
id="f0">4</td><td class="ctr2" id="g0">4</td><td class="ctr1" id="h0">9</td><td
class="ctr2" id="i0">9</td><td class="ctr1" id="j0">1</td><td class="ctr2"
id="k0">1</td></tr><tr><td id="a2"><a
href="MissingOptionException.java.html#L61"
class="el_method">MissingOptionException(List)</a></td><td class="bar"
id="b1"><img src="../jacoco-resources/redbar.gif" width="23" height="10" title=
"8" alt="8"/></td><td class="ctr2" id="c1">0%</td><td class="bar" id="d1"/><td
class="ctr2" id="e1">n/a</td><td class="ctr1" id="f1">1</td><td class="ctr2"
id="g1">1</td><td class="ctr1" id="h1">3</td><td class="ctr2" id="i1">3</td><td
class="ctr1" id="j1">1</td><td class="ctr2" id="k1">1</td></tr><tr><td
id="a3"><a href="MissingOptionException.java.html#L71"
class="el_method">MissingOptionException(String)</a></td><td class="bar"
id="b2"><img src="../jacoco-resources/redbar.gif" width="11" height="10"
title="4" alt="4"/></td><td class="ctr2" id="c2">0%</td><td class="bar"
id="d2"/><td class="ctr2" id="e2">n/a</td><td class="ctr1" id="f2">1</td><td
class="ctr2" id="g2">1</td><td class="ctr1" id="h2">2</td><td class="ctr2"
id="i2">2</td><td class="ctr1" id="j2">1</td><td class="ctr2"
id="k2">1</td></tr><tr><td id="a1"><a
href="MissingOptionException.java.html#L82"
class="el_method">getMissingOptions()</a></td><td class="bar" id="b3"><img
src="../jacoco-resources/redbar.gif" width="8"
height="10" title="3" alt="3"/></td><td class="ctr2" id="c3">0%</td><td
class="bar" id="d3"/><td class="ctr2" id="e3">n/a</td><td class="ctr1"
id="f3">1</td><td class="ctr2" id="g3">1</td><td class="ctr1" id="h3">1</td><td
class="ctr2" id="i3">1</td><td class="ctr1" id="j3">1</td><td class="ctr2"
id="k3">1</td></tr></tbody></table><div class="footer"><span
class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a>
0.8.12.202403310830</span></div></body></html>
\ No newline at end of file