public abstract class CommandDescriptor<T> extends Object
| Modifier and Type | Method and Description |
|---|---|
org.crsh.cli.impl.completion.CompletionMatcher<T> |
completer() |
ArgumentDescriptor |
getArgument(int index)
Returns a a specified argument by its index.
|
List<ArgumentDescriptor> |
getArguments()
Returns a list of the command arguments.
|
int |
getDepth() |
Description |
getDescription()
Returns the command description.
|
abstract org.crsh.cli.impl.invocation.CommandInvoker<T,?> |
getInvoker(org.crsh.cli.impl.invocation.InvocationMatch<T> match) |
Set<String> |
getLongOptionNames()
Returns the command long option names.
|
String |
getName()
Returns the command name.
|
OptionDescriptor |
getOption(String name)
Returns a command option by its name.
|
Set<String> |
getOptionNames()
Returns the command option names.
|
Collection<OptionDescriptor> |
getOptions()
Returns the command options.
|
abstract CommandDescriptor<T> |
getOwner() |
List<ParameterDescriptor> |
getParameters()
Returns the command parameters, the returned collection contains the command options and
the command arguments.
|
Set<String> |
getShortOptionNames()
Returns the command short option names.
|
CommandDescriptor<T> |
getSubordinate(String name)
Returns a specified subordinate.
|
abstract Map<String,? extends CommandDescriptor<T>> |
getSubordinates() |
String |
getUsage()
Returns the command usage, shortcut for invoking
getDescription().getUsage() on this
object. |
org.crsh.cli.impl.invocation.InvocationMatcher<T> |
matcher() |
void |
print(Format format,
Appendable to) |
void |
printMan(Appendable to) |
void |
printUsage(Appendable to) |
OptionDescriptor |
resolveOption(String name)
Find an command option by its name, this will look through the command hierarchy.
|
public abstract CommandDescriptor<T> getOwner()
public final int getDepth()
public final void printUsage(Appendable to) throws IOException
IOExceptionpublic final void printMan(Appendable to) throws IOException
IOExceptionpublic final void print(Format format, Appendable to) throws IOException
IOExceptionpublic abstract Map<String,? extends CommandDescriptor<T>> getSubordinates()
public final CommandDescriptor<T> getSubordinate(String name)
name - the subordinate namepublic final List<ParameterDescriptor> getParameters()
public final Set<String> getOptionNames()
public final Set<String> getShortOptionNames()
public final Set<String> getLongOptionNames()
public final Collection<OptionDescriptor> getOptions()
public final OptionDescriptor getOption(String name)
name - the option namepublic final OptionDescriptor resolveOption(String name)
name - the option namepublic final List<ArgumentDescriptor> getArguments()
public final ArgumentDescriptor getArgument(int index) throws IllegalArgumentException
index - the argument indexIllegalArgumentException - if the index is not within the boundspublic final String getName()
public final Description getDescription()
public final String getUsage()
getDescription().getUsage() on this
object.public abstract org.crsh.cli.impl.invocation.CommandInvoker<T,?> getInvoker(org.crsh.cli.impl.invocation.InvocationMatch<T> match)
public final org.crsh.cli.impl.invocation.InvocationMatcher<T> matcher()
public final org.crsh.cli.impl.completion.CompletionMatcher<T> completer()
Copyright © 2015 eXo Platform SAS. All Rights Reserved.