org.stanwood.media.cli
Class AbstractSubCLICommand

java.lang.Object
  extended by org.stanwood.media.cli.BaseLauncher
      extended by 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
 
Methods inherited from interface org.stanwood.media.cli.ICLICommand
getName
 

Constructor Detail

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 command
name - The name of the sub command
description - The description of the sub command
options - The sub command options
stdout - The standard output stream
stderr - The standard error stream
exitHandler - The exit handler
Method Detail

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)