public interface Command
Interface implemented by all CLI subcommands. Commands are detected by looking for implementations of this interface using the Java ServiceLoader
framework. New implementations can be registered conveniently using the AutoService
annotation.
Modifier and Type | Method and Description |
---|---|
void |
configureArguments(net.sourceforge.argparse4j.inf.ArgumentParser parser)
Configure the argument parser for this command.
|
void |
execute(net.sourceforge.argparse4j.inf.Namespace options)
Execute the command.
|
java.lang.String |
getHelp()
Get the command’s help.
|
java.lang.String |
getName()
Get the name of the command.
|
java.lang.String getName()
Get the name of the command.
java.lang.String getHelp()
Get the command’s help.
void configureArguments(net.sourceforge.argparse4j.inf.ArgumentParser parser)
Configure the argument parser for this command.
parser
- The argument parser into which the arguments should be configured. This will already be a subparser, the command is not responsible for creating that.void execute(net.sourceforge.argparse4j.inf.Namespace options) throws LenskitCommandException
Execute the command.
options
- The command-line options.java.lang.Exception
- if an error occurs in the command.LenskitCommandException