com.codetaco.cli.impl.usage.UsageBuilderLevel2 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cli Show documentation
Show all versions of cli Show documentation
A command line parser for Java
package com.codetaco.cli.impl.usage;
import com.codetaco.cli.impl.CmdLineImpl;
import com.codetaco.cli.impl.ICmdLine;
import com.codetaco.cli.impl.type.AbstractCLA;
import com.codetaco.cli.impl.type.ICmdLineArg;
/**
*
* UsageBuilderLevel2 class.
*
*
* @author Chris DeGreef [email protected]
* @since 4.3.4
*/
public class UsageBuilderLevel2 extends UsageBuilderLevel1 {
/**
*
* Constructor for UsageBuilderLevel2.
*
*/
public UsageBuilderLevel2() {
super();
}
/**
* {@inheritDoc}
*
*
* usageDetail.
*
*/
@Override
public void usageDetail(
final char commandPrefix,
final ICmdLineArg> arg,
final int _indentLevel) {
nameIt(commandPrefix, arg);
final String help = ((AbstractCLA>) arg).getHelp();
if (help != null && help.trim().length() > 0) {
allign(29);
append(help);
unallign();
newLine();
}
}
/**
* @param commandPrefix
* @param icmdLine
* @param indentLevel
*/
@Override
void usageHeader(
final char commandPrefix,
final ICmdLine icmdLine,
final int indentLevel) {
final CmdLineImpl commandLineParser = (CmdLineImpl) icmdLine;
if (commandLineParser.getName() != null) {
append(commandLineParser.getName());
newLine(indentLevel);
newLine();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy