fr.umlv.tatoo.cc.common.main
Class UsageFormatter
java.lang.Object
fr.umlv.tatoo.cc.common.main.UsageFormatter
public class UsageFormatter
- extends Object
Format the usage of a CommandLineParser
.
- Author:
- remi
- See Also:
CommandLineParser
,
CommandLineParser.Option
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_OPTION_LENGTH
public static final int DEFAULT_OPTION_LENGTH
- See Also:
- Constant Field Values
DEFAULT_DEPTH
public static final int DEFAULT_DEPTH
- See Also:
- Constant Field Values
UsageFormatter
public UsageFormatter()
usage
public String usage(String comment,
Map<? extends Command<?>,? extends Set<? extends CommandLineParser.Option>> commands,
int depth,
int optionLength)
- returns the usage of a set of command.
- Parameters:
comment
- general comment of the program.commands
- map that associate options informations
Info
to a command.depth
- shift in character for each line of the usageoptionLength
- size in caracter reserved for printing option information
- Returns:
- the formatted usage
optionText
protected StringBuilder optionText(StringBuilder optBuilder,
Command<?> command,
String option,
int numberOfArgument)