Skip to content

Commit b906eee

Browse files
committed
Sort members
1 parent 0b115d5 commit b906eee

1 file changed

Lines changed: 19 additions & 19 deletions

File tree

src/main/java/org/apache/commons/cli/HelpFormatter.java

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -109,36 +109,26 @@ public Builder setPrintWriter(final PrintWriter printWriter) {
109109
/**
110110
* Sets whether to show deprecated options.
111111
*
112-
* @param showDeprecatedFunc Specify the format for the deprecated options.
112+
* @param useDefaultFormat if {@code true} use the default format, otherwise clear the formatter.
113113
* @return this.
114-
* @since 1.8.0
115114
*/
116-
public Builder setShowDeprecated(final Function<Option, String> showDeprecatedFunc) {
117-
this.deprecatedFormatFunc = showDeprecatedFunc;
118-
return this;
115+
public Builder setShowDeprecated(final boolean useDefaultFormat) {
116+
return setShowDeprecated(useDefaultFormat ? DEFAULT_DEPRECATED_FORMAT : null);
119117
}
120118

121119
/**
122120
* Sets whether to show deprecated options.
123121
*
124-
* @param useDefaultFormat if {@code true} use the default format, otherwise clear the formatter.
122+
* @param showDeprecatedFunc Specify the format for the deprecated options.
125123
* @return this.
124+
* @since 1.8.0
126125
*/
127-
public Builder setShowDeprecated(final boolean useDefaultFormat) {
128-
return setShowDeprecated(useDefaultFormat ? DEFAULT_DEPRECATED_FORMAT : null);
126+
public Builder setShowDeprecated(final Function<Option, String> showDeprecatedFunc) {
127+
this.deprecatedFormatFunc = showDeprecatedFunc;
128+
return this;
129129
}
130130
}
131131

132-
/**
133-
* Gets the option description or an empty string if the description is {@code null}.
134-
* @param option The option to get the description from.
135-
* @return the option description or an empty string if the description is {@code null}.
136-
* @since 1.8.0
137-
*/
138-
public static String getDescription(final Option option) {
139-
String desc = option.getDescription();
140-
return desc == null ? "" : desc;
141-
}
142132
/**
143133
* This class implements the {@code Comparator} interface for comparing Options.
144134
*/
@@ -161,7 +151,6 @@ public int compare(final Option opt1, final Option opt2) {
161151
return opt1.getKey().compareToIgnoreCase(opt2.getKey());
162152
}
163153
}
164-
165154
/** Default number of characters per line */
166155
public static final int DEFAULT_WIDTH = 74;
167156

@@ -204,6 +193,17 @@ private static PrintWriter createDefaultPrintWriter() {
204193
return new PrintWriter(System.out);
205194
}
206195

196+
/**
197+
* Gets the option description or an empty string if the description is {@code null}.
198+
* @param option The option to get the description from.
199+
* @return the option description or an empty string if the description is {@code null}.
200+
* @since 1.8.0
201+
*/
202+
public static String getDescription(final Option option) {
203+
String desc = option.getDescription();
204+
return desc == null ? "" : desc;
205+
}
206+
207207
/**
208208
* Number of characters per line
209209
*

0 commit comments

Comments
 (0)