public abstract class SubCommand extends Object
Sub-command for a certain CLI operation.
The CloudStore-command-line-interface uses a syntax similar to the svn command and the logic of the
command 'java -jar co.codewizards.cloudstore.client-VERSION.jar SUBCOMMAND -arg1 val1 -arg2 val2 ...'
is thus actually implemented by a class extending this class and registering
for a certain 'SUBCOMMAND'.
Every subclass of this class can declare its arguments using annotations like Option
.
Constructor and Description |
---|
SubCommand() |
Modifier and Type | Method and Description |
---|---|
void |
cleanUp()
Invoked after
run() . |
LocalServerRestClient |
getLocalServerRestClient() |
abstract String |
getSubCommandDescription()
Get the description for this sub-command.
|
String |
getSubCommandName()
Get the name of the sub-command, i.e.
|
boolean |
isVisibleInHelp() |
void |
prepare()
Invoked before
run() . |
protected String |
prompt(String fmt,
Object... args) |
protected String |
promptPassword(String fmt,
Object... args) |
abstract void |
run() |
public SubCommand()
public String getSubCommandName()
public abstract String getSubCommandDescription()
public void prepare() throws Exception
run()
.
Implementors should always invoked the super-method when overriding!
protected String promptPassword(String fmt, Object... args)
public boolean isVisibleInHelp()
public LocalServerRestClient getLocalServerRestClient()
Copyright © 2013–2019. All rights reserved.