@@ -67,7 +67,7 @@ public final void usage(String commandName, StringBuilder out, String indent) {
67
67
68
68
if (description != null ) {
69
69
out .append (indent ).append (description );
70
- out .append (" \n " );
70
+ out .append ('\n' );
71
71
}
72
72
jc .getUsageFormatter ().usage (out , indent );
73
73
}
@@ -154,7 +154,7 @@ public void appendMainLine(StringBuilder out, boolean hasOptions, boolean hasCom
154
154
mainLine .append (" " ).append (commander .getMainParameter ().getDescription ().getDescription ());
155
155
}
156
156
wrapDescription (out , indentCount , mainLine .toString ());
157
- out .append (" \n " );
157
+ out .append ('\n' );
158
158
}
159
159
160
160
/**
@@ -169,7 +169,7 @@ public void appendMainLine(StringBuilder out, boolean hasOptions, boolean hasCom
169
169
public void appendAllParametersDetails (StringBuilder out , int indentCount , String indent ,
170
170
List <ParameterDescription > sortedParameters ) {
171
171
if (sortedParameters .size () > 0 ) {
172
- out .append (" \n " );
172
+ out .append ('\n' );
173
173
out .append (indent ).append (" Options:\n " );
174
174
}
175
175
@@ -183,7 +183,7 @@ public void appendAllParametersDetails(StringBuilder out, int indentCount, Strin
183
183
.append (" " )
184
184
.append (parameter .required () ? "* " : " " )
185
185
.append (pd .getNames ())
186
- .append (" \n " );
186
+ .append ('\n' );
187
187
188
188
if (hasDescription ) {
189
189
wrapDescription (out , indentCount , s (indentCount ) + description );
@@ -242,7 +242,7 @@ public void appendAllParametersDetails(StringBuilder out, int indentCount, Strin
242
242
out .append (possibleValues );
243
243
}
244
244
}
245
- out .append (" \n " );
245
+ out .append ('\n' );
246
246
}
247
247
}
248
248
@@ -270,18 +270,18 @@ public void appendCommands(StringBuilder out, int indentCount, int descriptionIn
270
270
if (hasOnlyHiddenCommands )
271
271
return ;
272
272
273
- out .append (" \n " );
273
+ out .append ('\n' );
274
274
out .append (indent + " Commands:\n " );
275
275
276
- boolean firstCommand = true ;
276
+ var firstCommand = true ;
277
277
// The magic value 3 is the number of spaces between the name of the option and its description
278
278
for (Map .Entry <JCommander .ProgramName , JCommander > commands : commander .getRawCommands ().entrySet ()) {
279
279
Object arg = commands .getValue ().getObjects ().get (0 );
280
280
Parameters p = arg .getClass ().getAnnotation (Parameters .class );
281
281
282
282
if (p == null || !p .hidden ()) {
283
283
if (!firstCommand ) {
284
- out .append (" \n " );
284
+ out .append ('\n' );
285
285
} else {
286
286
firstCommand = false ;
287
287
}
@@ -292,7 +292,7 @@ public void appendCommands(StringBuilder out, int indentCount, int descriptionIn
292
292
.orElse ("" );
293
293
String description = indent + s (4 ) + dispName + commandDescription ;
294
294
wrapDescription (out , indentCount + descriptionIndent , description );
295
- out .append (" \n " );
295
+ out .append ('\n' );
296
296
297
297
// Options for this command
298
298
JCommander jc = commander .findCommandByAlias (progName .getName ());
@@ -369,7 +369,7 @@ public void wrapDescription(StringBuilder out, int indent, int currentLineIndent
369
369
current ++;
370
370
}
371
371
} else {
372
- out .append (" \n " ).append (s (indent )).append (word ).append (" " );
372
+ out .append ('\n' ).append (s (indent )).append (word ).append (" " );
373
373
current = indent + word .length () + 1 ;
374
374
}
375
375
}
0 commit comments