|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjcmdline.TextUsageFormatter
public class TextUsageFormatter
Used to format a command's usage.
CmdLineHandler| Constructor Summary | |
|---|---|
TextUsageFormatter()
constructor |
|
| Method Summary | |
|---|---|
java.lang.String |
formatErrorMsg(java.lang.String msg)
Gets an error message, reformatted in a manner to "go well with" the usage statement. |
java.lang.String |
formatText(java.lang.String text,
int indent,
int lineLen)
|
java.lang.String |
formatUsage(java.lang.String cmdName,
java.lang.String cmdDesc,
java.util.Map opts,
java.util.List args,
boolean showHidden)
gets the usage for the command |
int |
getLineLength()
Gets the maximum line length to use for usage display. |
void |
setLineLength(int lineLength)
Sets the maximum line length to use for usage display - default is 80. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TextUsageFormatter()
| Method Detail |
|---|
public java.lang.String formatUsage(java.lang.String cmdName,
java.lang.String cmdDesc,
java.util.Map opts,
java.util.List args,
boolean showHidden)
formatUsage in interface UsageFormattercmdName - the command namecmdDesc - the command descriptionopts - a Map of command options; keys are the option
tags, values are the option objectsargs - the command argumentsshowHidden - if true, hidden parameters will be
displayed
public java.lang.String formatErrorMsg(java.lang.String msg)
ERROR: invalid filename
when called as:
formatErrorMsg("invalid filename")
formatErrorMsg in interface UsageFormattermsg - the text of the error message
public java.lang.String formatText(java.lang.String text,
int indent,
int lineLen)
public void setLineLength(int lineLength)
setLineLength in interface UsageFormatterlineLength - the maximum line length to use for usage displaygetLineLength()public int getLineLength()
getLineLength in interface UsageFormattersetLineLength()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||