Return-Path: X-Original-To: apmail-commons-notifications-archive@minotaur.apache.org Delivered-To: apmail-commons-notifications-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 55E80100B9 for ; Sat, 9 May 2015 18:19:22 +0000 (UTC) Received: (qmail 36333 invoked by uid 500); 9 May 2015 18:19:22 -0000 Delivered-To: apmail-commons-notifications-archive@commons.apache.org Received: (qmail 36288 invoked by uid 500); 9 May 2015 18:19:22 -0000 Mailing-List: contact notifications-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list notifications@commons.apache.org Received: (qmail 36080 invoked by uid 99); 9 May 2015 18:19:22 -0000 Received: from eris.apache.org (HELO hades.apache.org) (140.211.11.105) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 May 2015 18:19:22 +0000 Received: from hades.apache.org (localhost [127.0.0.1]) by hades.apache.org (ASF Mail Server at hades.apache.org) with ESMTP id 0A148AC1435 for ; Sat, 9 May 2015 18:19:22 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r950741 [36/40] - in /websites/production/commons/content/proper/commons-cli: ./ apidocs/ apidocs/org/apache/commons/cli/ apidocs/org/apache/commons/cli/class-use/ apidocs/resources/ apidocs/src-html/org/apache/commons/cli/ cobertura/ jacoc... Date: Sat, 09 May 2015 18:19:17 -0000 To: notifications@commons.apache.org From: britter@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20150509181922.0A148AC1435@hades.apache.org> Modified: websites/production/commons/content/proper/commons-cli/xref/org/apache/commons/cli/HelpFormatter.html ============================================================================== --- websites/production/commons/content/proper/commons-cli/xref/org/apache/commons/cli/HelpFormatter.html (original) +++ websites/production/commons/content/proper/commons-cli/xref/org/apache/commons/cli/HelpFormatter.html Sat May 9 18:19:15 2015 @@ -66,17 +66,17 @@ 58 * This produces the following output: 59 * 60 * <pre> -61 * usage: myapp -f <FILE> [-h] [-v] +61 * usage: myapp -f &lt;FILE&gt; [-h] [-v] 62 * Do something useful with an input file 63 * -64 * -f,--file &lt;FILE> The file to be processed +64 * -f,--file &lt;FILE&gt; The file to be processed 65 * -h,--help 66 * -v,--version Print the version of the application 67 * 68 * Please report issues at http://example.com/issues 69 * </pre> 70 * -71 * @version $Id: HelpFormatter.java 1444961 2013-02-11 21:03:51Z tn $ +71 * @version $Id: HelpFormatter.java 1677407 2015-05-03 14:31:12Z britter $ 72 */ 73 public class HelpFormatter 74 { @@ -100,1002 +100,1006 @@ 92 /** default prefix for long Option */ 93 public static final String DEFAULT_LONG_OPT_PREFIX = "--"; 94 -95 /** default separator displayed between a long Option and its value */ -96 public static final String DEFAULT_LONG_OPT_SEPARATOR = " "; -97 -98 /** default name for an argument */ -99 public static final String DEFAULT_ARG_NAME = "arg"; -100 -101 // -------------------------------------------------------------- Attributes -102 -103 /** -104 * number of characters per line -105 * -106 * @deprecated Scope will be made private for next major version -107 * - use get/setWidth methods instead. -108 */ -109 @Deprecated -110 public int defaultWidth = DEFAULT_WIDTH; -111 -112 /** -113 * amount of padding to the left of each line -114 * -115 * @deprecated Scope will be made private for next major version -116 * - use get/setLeftPadding methods instead. -117 */ -118 @Deprecated -119 public int defaultLeftPad = DEFAULT_LEFT_PAD; -120 -121 /** -122 * the number of characters of padding to be prefixed -123 * to each description line -124 * -125 * @deprecated Scope will be made private for next major version -126 * - use get/setDescPadding methods instead. -127 */ -128 @Deprecated -129 public int defaultDescPad = DEFAULT_DESC_PAD; -130 -131 /** -132 * the string to display at the beginning of the usage statement -133 * -134 * @deprecated Scope will be made private for next major version -135 * - use get/setSyntaxPrefix methods instead. -136 */ -137 @Deprecated -138 public String defaultSyntaxPrefix = DEFAULT_SYNTAX_PREFIX; -139 -140 /** -141 * the new line string -142 * -143 * @deprecated Scope will be made private for next major version -144 * - use get/setNewLine methods instead. -145 */ -146 @Deprecated -147 public String defaultNewLine = System.getProperty("line.separator"); -148 -149 /** -150 * the shortOpt prefix -151 * -152 * @deprecated Scope will be made private for next major version -153 * - use get/setOptPrefix methods instead. -154 */ -155 @Deprecated -156 public String defaultOptPrefix = DEFAULT_OPT_PREFIX; -157 -158 /** -159 * the long Opt prefix -160 * -161 * @deprecated Scope will be made private for next major version -162 * - use get/setLongOptPrefix methods instead. -163 */ -164 @Deprecated -165 public String defaultLongOptPrefix = DEFAULT_LONG_OPT_PREFIX; -166 -167 /** -168 * the name of the argument -169 * -170 * @deprecated Scope will be made private for next major version -171 * - use get/setArgName methods instead. -172 */ -173 @Deprecated -174 public String defaultArgName = DEFAULT_ARG_NAME; -175 -176 /** -177 * Comparator used to sort the options when they output in help text -178 * -179 * Defaults to case-insensitive alphabetical sorting by option key -180 */ -181 protected Comparator<Option> optionComparator = new OptionComparator(); -182 -183 /** The separator displayed between the long option and its value. */ -184 private String longOptSeparator = DEFAULT_LONG_OPT_SEPARATOR; -185 -186 /** -187 * Sets the 'width'. -188 * -189 * @param width the new value of 'width' -190 */ -191 public void setWidth(int width) -192 { -193 this.defaultWidth = width; -194 } -195 -196 /** -197 * Returns the 'width'. -198 * -199 * @return the 'width' -200 */ -201 public int getWidth() -202 { -203 return defaultWidth; -204 } -205 -206 /** -207 * Sets the 'leftPadding'. -208 * -209 * @param padding the new value of 'leftPadding' -210 */ -211 public void setLeftPadding(int padding) -212 { -213 this.defaultLeftPad = padding; -214 } -215 -216 /** -217 * Returns the 'leftPadding'. -218 * -219 * @return the 'leftPadding' -220 */ -221 public int getLeftPadding() -222 { -223 return defaultLeftPad; -224 } -225 -226 /** -227 * Sets the 'descPadding'. -228 * -229 * @param padding the new value of 'descPadding' -230 */ -231 public void setDescPadding(int padding) -232 { -233 this.defaultDescPad = padding; -234 } -235 -236 /** -237 * Returns the 'descPadding'. -238 * -239 * @return the 'descPadding' -240 */ -241 public int getDescPadding() -242 { -243 return defaultDescPad; -244 } -245 -246 /** -247 * Sets the 'syntaxPrefix'. -248 * -249 * @param prefix the new value of 'syntaxPrefix' -250 */ -251 public void setSyntaxPrefix(String prefix) -252 { -253 this.defaultSyntaxPrefix = prefix; -254 } -255 -256 /** -257 * Returns the 'syntaxPrefix'. -258 * -259 * @return the 'syntaxPrefix' -260 */ -261 public String getSyntaxPrefix() -262 { -263 return defaultSyntaxPrefix; -264 } -265 -266 /** -267 * Sets the 'newLine'. -268 * -269 * @param newline the new value of 'newLine' -270 */ -271 public void setNewLine(String newline) -272 { -273 this.defaultNewLine = newline; -274 } -275 -276 /** -277 * Returns the 'newLine'. -278 * -279 * @return the 'newLine' -280 */ -281 public String getNewLine() -282 { -283 return defaultNewLine; -284 } -285 -286 /** -287 * Sets the 'optPrefix'. -288 * -289 * @param prefix the new value of 'optPrefix' -290 */ -291 public void setOptPrefix(String prefix) -292 { -293 this.defaultOptPrefix = prefix; -294 } -295 -296 /** -297 * Returns the 'optPrefix'. -298 * -299 * @return the 'optPrefix' -300 */ -301 public String getOptPrefix() -302 { -303 return defaultOptPrefix; -304 } -305 -306 /** -307 * Sets the 'longOptPrefix'. -308 * -309 * @param prefix the new value of 'longOptPrefix' -310 */ -311 public void setLongOptPrefix(String prefix) -312 { -313 this.defaultLongOptPrefix = prefix; -314 } -315 -316 /** -317 * Returns the 'longOptPrefix'. -318 * -319 * @return the 'longOptPrefix' -320 */ -321 public String getLongOptPrefix() -322 { -323 return defaultLongOptPrefix; -324 } -325 -326 /** -327 * Set the separator displayed between a long option and its value. -328 * Ensure that the separator specified is supported by the parser used, -329 * typically ' ' or '='. -330 * -331 * @param longOptSeparator the separator, typically ' ' or '='. -332 * @since 1.3 -333 */ -334 public void setLongOptSeparator(String longOptSeparator) -335 { -336 this.longOptSeparator = longOptSeparator; -337 } -338 -339 /** -340 * Returns the separator displayed between a long option and its value. -341 * -342 * @return the separator -343 * @since 1.3 -344 */ -345 public String getLongOptSeparator() -346 { -347 return longOptSeparator; -348 } -349 -350 /** -351 * Sets the 'argName'. -352 * -353 * @param name the new value of 'argName' -354 */ -355 public void setArgName(String name) -356 { -357 this.defaultArgName = name; -358 } -359 -360 /** -361 * Returns the 'argName'. -362 * -363 * @return the 'argName' -364 */ -365 public String getArgName() -366 { -367 return defaultArgName; -368 } -369 -370 /** -371 * Comparator used to sort the options when they output in help text. -372 * Defaults to case-insensitive alphabetical sorting by option key. -373 * -374 * @return the {@link Comparator} currently in use to sort the options -375 * @since 1.2 -376 */ -377 public Comparator<Option> getOptionComparator() -378 { -379 return optionComparator; -380 } -381 -382 /** -383 * Set the comparator used to sort the options when they output in help text. -384 * Passing in a null comparator will keep the options in the order they were declared. -385 * -386 * @param comparator the {@link Comparator} to use for sorting the options -387 * @since 1.2 -388 */ -389 public void setOptionComparator(Comparator<Option> comparator) -390 { -391 this.optionComparator = comparator; -392 } -393 -394 /** -395 * Print the help for <code>options</code> with the specified -396 * command line syntax. This method prints help information to -397 * System.out. -398 * -399 * @param cmdLineSyntax the syntax for this application -400 * @param options the Options instance -401 */ -402 public void printHelp(String cmdLineSyntax, Options options) -403 { -404 printHelp(getWidth(), cmdLineSyntax, null, options, null, false); -405 } -406 -407 /** -408 * Print the help for <code>options</code> with the specified -409 * command line syntax. This method prints help information to -410 * System.out. -411 * -412 * @param cmdLineSyntax the syntax for this application -413 * @param options the Options instance -414 * @param autoUsage whether to print an automatically generated -415 * usage statement -416 */ -417 public void printHelp(String cmdLineSyntax, Options options, boolean autoUsage) -418 { -419 printHelp(getWidth(), cmdLineSyntax, null, options, null, autoUsage); -420 } -421 -422 /** -423 * Print the help for <code>options</code> with the specified -424 * command line syntax. This method prints help information to -425 * System.out. -426 * -427 * @param cmdLineSyntax the syntax for this application -428 * @param header the banner to display at the beginning of the help -429 * @param options the Options instance -430 * @param footer the banner to display at the end of the help -431 */ -432 public void printHelp(String cmdLineSyntax, String header, Options options, String footer) -433 { -434 printHelp(cmdLineSyntax, header, options, footer, false); -435 } -436 -437 /** -438 * Print the help for <code>options</code> with the specified -439 * command line syntax. This method prints help information to -440 * System.out. -441 * -442 * @param cmdLineSyntax the syntax for this application -443 * @param header the banner to display at the beginning of the help -444 * @param options the Options instance -445 * @param footer the banner to display at the end of the help -446 * @param autoUsage whether to print an automatically generated -447 * usage statement -448 */ -449 public void printHelp(String cmdLineSyntax, String header, Options options, String footer, boolean autoUsage) -450 { -451 printHelp(getWidth(), cmdLineSyntax, header, options, footer, autoUsage); -452 } -453 -454 /** -455 * Print the help for <code>options</code> with the specified -456 * command line syntax. This method prints help information to -457 * System.out. -458 * -459 * @param width the number of characters to be displayed on each line -460 * @param cmdLineSyntax the syntax for this application -461 * @param header the banner to display at the beginning of the help -462 * @param options the Options instance -463 * @param footer the banner to display at the end of the help -464 */ -465 public void printHelp(int width, String cmdLineSyntax, String header, Options options, String footer) -466 { -467 printHelp(width, cmdLineSyntax, header, options, footer, false); -468 } -469 -470 /** -471 * Print the help for <code>options</code> with the specified -472 * command line syntax. This method prints help information to -473 * System.out. -474 * -475 * @param width the number of characters to be displayed on each line -476 * @param cmdLineSyntax the syntax for this application -477 * @param header the banner to display at the beginning of the help -478 * @param options the Options instance -479 * @param footer the banner to display at the end of the help -480 * @param autoUsage whether to print an automatically generated -481 * usage statement -482 */ -483 public void printHelp(int width, String cmdLineSyntax, String header, -484 Options options, String footer, boolean autoUsage) -485 { -486 PrintWriter pw = new PrintWriter(System.out); -487 -488 printHelp(pw, width, cmdLineSyntax, header, options, getLeftPadding(), getDescPadding(), footer, autoUsage); -489 pw.flush(); -490 } +95 /** +96 * default separator displayed between a long Option and its value +97 * +98 * @since 1.3 +99 **/ +100 public static final String DEFAULT_LONG_OPT_SEPARATOR = " "; +101 +102 /** default name for an argument */ +103 public static final String DEFAULT_ARG_NAME = "arg"; +104 +105 // -------------------------------------------------------------- Attributes +106 +107 /** +108 * number of characters per line +109 * +110 * @deprecated Scope will be made private for next major version +111 * - use get/setWidth methods instead. +112 */ +113 @Deprecated +114 public int defaultWidth = DEFAULT_WIDTH; +115 +116 /** +117 * amount of padding to the left of each line +118 * +119 * @deprecated Scope will be made private for next major version +120 * - use get/setLeftPadding methods instead. +121 */ +122 @Deprecated +123 public int defaultLeftPad = DEFAULT_LEFT_PAD; +124 +125 /** +126 * the number of characters of padding to be prefixed +127 * to each description line +128 * +129 * @deprecated Scope will be made private for next major version +130 * - use get/setDescPadding methods instead. +131 */ +132 @Deprecated +133 public int defaultDescPad = DEFAULT_DESC_PAD; +134 +135 /** +136 * the string to display at the beginning of the usage statement +137 * +138 * @deprecated Scope will be made private for next major version +139 * - use get/setSyntaxPrefix methods instead. +140 */ +141 @Deprecated +142 public String defaultSyntaxPrefix = DEFAULT_SYNTAX_PREFIX; +143 +144 /** +145 * the new line string +146 * +147 * @deprecated Scope will be made private for next major version +148 * - use get/setNewLine methods instead. +149 */ +150 @Deprecated +151 public String defaultNewLine = System.getProperty("line.separator"); +152 +153 /** +154 * the shortOpt prefix +155 * +156 * @deprecated Scope will be made private for next major version +157 * - use get/setOptPrefix methods instead. +158 */ +159 @Deprecated +160 public String defaultOptPrefix = DEFAULT_OPT_PREFIX; +161 +162 /** +163 * the long Opt prefix +164 * +165 * @deprecated Scope will be made private for next major version +166 * - use get/setLongOptPrefix methods instead. +167 */ +168 @Deprecated +169 public String defaultLongOptPrefix = DEFAULT_LONG_OPT_PREFIX; +170 +171 /** +172 * the name of the argument +173 * +174 * @deprecated Scope will be made private for next major version +175 * - use get/setArgName methods instead. +176 */ +177 @Deprecated +178 public String defaultArgName = DEFAULT_ARG_NAME; +179 +180 /** +181 * Comparator used to sort the options when they output in help text +182 * +183 * Defaults to case-insensitive alphabetical sorting by option key +184 */ +185 protected Comparator<Option> optionComparator = new OptionComparator(); +186 +187 /** The separator displayed between the long option and its value. */ +188 private String longOptSeparator = DEFAULT_LONG_OPT_SEPARATOR; +189 +190 /** +191 * Sets the 'width'. +192 * +193 * @param width the new value of 'width' +194 */ +195 public void setWidth(int width) +196 { +197 this.defaultWidth = width; +198 } +199 +200 /** +201 * Returns the 'width'. +202 * +203 * @return the 'width' +204 */ +205 public int getWidth() +206 { +207 return defaultWidth; +208 } +209 +210 /** +211 * Sets the 'leftPadding'. +212 * +213 * @param padding the new value of 'leftPadding' +214 */ +215 public void setLeftPadding(int padding) +216 { +217 this.defaultLeftPad = padding; +218 } +219 +220 /** +221 * Returns the 'leftPadding'. +222 * +223 * @return the 'leftPadding' +224 */ +225 public int getLeftPadding() +226 { +227 return defaultLeftPad; +228 } +229 +230 /** +231 * Sets the 'descPadding'. +232 * +233 * @param padding the new value of 'descPadding' +234 */ +235 public void setDescPadding(int padding) +236 { +237 this.defaultDescPad = padding; +238 } +239 +240 /** +241 * Returns the 'descPadding'. +242 * +243 * @return the 'descPadding' +244 */ +245 public int getDescPadding() +246 { +247 return defaultDescPad; +248 } +249 +250 /** +251 * Sets the 'syntaxPrefix'. +252 * +253 * @param prefix the new value of 'syntaxPrefix' +254 */ +255 public void setSyntaxPrefix(String prefix) +256 { +257 this.defaultSyntaxPrefix = prefix; +258 } +259 +260 /** +261 * Returns the 'syntaxPrefix'. +262 * +263 * @return the 'syntaxPrefix' +264 */ +265 public String getSyntaxPrefix() +266 { +267 return defaultSyntaxPrefix; +268 } +269 +270 /** +271 * Sets the 'newLine'. +272 * +273 * @param newline the new value of 'newLine' +274 */ +275 public void setNewLine(String newline) +276 { +277 this.defaultNewLine = newline; +278 } +279 +280 /** +281 * Returns the 'newLine'. +282 * +283 * @return the 'newLine' +284 */ +285 public String getNewLine() +286 { +287 return defaultNewLine; +288 } +289 +290 /** +291 * Sets the 'optPrefix'. +292 * +293 * @param prefix the new value of 'optPrefix' +294 */ +295 public void setOptPrefix(String prefix) +296 { +297 this.defaultOptPrefix = prefix; +298 } +299 +300 /** +301 * Returns the 'optPrefix'. +302 * +303 * @return the 'optPrefix' +304 */ +305 public String getOptPrefix() +306 { +307 return defaultOptPrefix; +308 } +309 +310 /** +311 * Sets the 'longOptPrefix'. +312 * +313 * @param prefix the new value of 'longOptPrefix' +314 */ +315 public void setLongOptPrefix(String prefix) +316 { +317 this.defaultLongOptPrefix = prefix; +318 } +319 +320 /** +321 * Returns the 'longOptPrefix'. +322 * +323 * @return the 'longOptPrefix' +324 */ +325 public String getLongOptPrefix() +326 { +327 return defaultLongOptPrefix; +328 } +329 +330 /** +331 * Set the separator displayed between a long option and its value. +332 * Ensure that the separator specified is supported by the parser used, +333 * typically ' ' or '='. +334 * +335 * @param longOptSeparator the separator, typically ' ' or '='. +336 * @since 1.3 +337 */ +338 public void setLongOptSeparator(String longOptSeparator) +339 { +340 this.longOptSeparator = longOptSeparator; +341 } +342 +343 /** +344 * Returns the separator displayed between a long option and its value. +345 * +346 * @return the separator +347 * @since 1.3 +348 */ +349 public String getLongOptSeparator() +350 { +351 return longOptSeparator; +352 } +353 +354 /** +355 * Sets the 'argName'. +356 * +357 * @param name the new value of 'argName' +358 */ +359 public void setArgName(String name) +360 { +361 this.defaultArgName = name; +362 } +363 +364 /** +365 * Returns the 'argName'. +366 * +367 * @return the 'argName' +368 */ +369 public String getArgName() +370 { +371 return defaultArgName; +372 } +373 +374 /** +375 * Comparator used to sort the options when they output in help text. +376 * Defaults to case-insensitive alphabetical sorting by option key. +377 * +378 * @return the {@link Comparator} currently in use to sort the options +379 * @since 1.2 +380 */ +381 public Comparator<Option> getOptionComparator() +382 { +383 return optionComparator; +384 } +385 +386 /** +387 * Set the comparator used to sort the options when they output in help text. +388 * Passing in a null comparator will keep the options in the order they were declared. +389 * +390 * @param comparator the {@link Comparator} to use for sorting the options +391 * @since 1.2 +392 */ +393 public void setOptionComparator(Comparator<Option> comparator) +394 { +395 this.optionComparator = comparator; +396 } +397 +398 /** +399 * Print the help for <code>options</code> with the specified +400 * command line syntax. This method prints help information to +401 * System.out. +402 * +403 * @param cmdLineSyntax the syntax for this application +404 * @param options the Options instance +405 */ +406 public void printHelp(String cmdLineSyntax, Options options) +407 { +408 printHelp(getWidth(), cmdLineSyntax, null, options, null, false); +409 } +410 +411 /** +412 * Print the help for <code>options</code> with the specified +413 * command line syntax. This method prints help information to +414 * System.out. +415 * +416 * @param cmdLineSyntax the syntax for this application +417 * @param options the Options instance +418 * @param autoUsage whether to print an automatically generated +419 * usage statement +420 */ +421 public void printHelp(String cmdLineSyntax, Options options, boolean autoUsage) +422 { +423 printHelp(getWidth(), cmdLineSyntax, null, options, null, autoUsage); +424 } +425 +426 /** +427 * Print the help for <code>options</code> with the specified +428 * command line syntax. This method prints help information to +429 * System.out. +430 * +431 * @param cmdLineSyntax the syntax for this application [... 1246 lines stripped ...]