org.stanwood.media.cli
Class AbstractSubCLICommand
java.lang.Object
org.stanwood.media.cli.BaseLauncher
org.stanwood.media.cli.AbstractSubCLICommand
- All Implemented Interfaces:
- ICLICommand
- Direct Known Subclasses:
- AbstractXBMCSubCommand
public abstract class AbstractSubCLICommand
- extends BaseLauncher
- implements ICLICommand
This is a abstract base class for the sub commands of CLI commands
Constructor Summary |
AbstractSubCLICommand(ICLICommand rootCommand,
java.lang.String name,
java.lang.String description,
java.util.List<org.apache.commons.cli.Option> options,
IExitHandler exitHandler,
java.io.PrintStream stdout,
java.io.PrintStream stderr)
The constructor |
Method Summary |
java.lang.String |
getDescription()
Used to get the sub command description |
protected java.lang.String |
getPrintArguments()
|
protected void |
printUsage(org.apache.commons.cli.Options options,
java.io.PrintStream stdout,
java.io.PrintStream stderr)
|
protected abstract boolean |
processOptions(java.lang.String[] args,
org.apache.commons.cli.CommandLine cmd)
|
protected boolean |
processOptionsInternal(java.lang.String[] args,
org.apache.commons.cli.CommandLine cmd)
|
Methods inherited from class org.stanwood.media.cli.BaseLauncher |
addOption, checkSubCommand, displayHelp, doExit, fatal, fatal, getName, getOptions, getStderr, getStdout, handleBadSubCommandOption, info, init, launch, printOptions, run, shouldDisplayHelp, warn |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractSubCLICommand
public AbstractSubCLICommand(ICLICommand rootCommand,
java.lang.String name,
java.lang.String description,
java.util.List<org.apache.commons.cli.Option> options,
IExitHandler exitHandler,
java.io.PrintStream stdout,
java.io.PrintStream stderr)
- The constructor
- Parameters:
rootCommand
- The parent commandname
- The name of the sub commanddescription
- The description of the sub commandoptions
- The sub command optionsstdout
- The standard output streamstderr
- The standard error streamexitHandler
- The exit handler
getDescription
public java.lang.String getDescription()
- Used to get the sub command description
- Returns:
- the sub command description
printUsage
protected void printUsage(org.apache.commons.cli.Options options,
java.io.PrintStream stdout,
java.io.PrintStream stderr)
- Overrides:
printUsage
in class BaseLauncher
getPrintArguments
protected java.lang.String getPrintArguments()
processOptionsInternal
protected boolean processOptionsInternal(java.lang.String[] args,
org.apache.commons.cli.CommandLine cmd)
- Specified by:
processOptionsInternal
in class BaseLauncher
processOptions
protected abstract boolean processOptions(java.lang.String[] args,
org.apache.commons.cli.CommandLine cmd)