public interface Command
Modifier and Type | Method and Description |
---|---|
String |
getCommandName()
Gets the command name as input from the shell.
|
String |
getDescription() |
default org.apache.commons.cli.Options |
getOptions() |
String |
getUsage() |
default org.apache.commons.cli.CommandLine |
parseAndValidateArgs(String... args)
Parses and validates the arguments.
|
int |
run(org.apache.commons.cli.CommandLine cl)
Runs the command.
|
default void |
validateArgs(org.apache.commons.cli.CommandLine cl)
Checks if the arguments are valid or throw InvalidArgumentException.
|
String getCommandName()
default org.apache.commons.cli.Options getOptions()
Options
of the commanddefault org.apache.commons.cli.CommandLine parseAndValidateArgs(String... args) throws InvalidArgumentException
args
- the arguments for the command, excluding the command nameInvalidArgumentException
- when arguments are not validdefault void validateArgs(org.apache.commons.cli.CommandLine cl) throws InvalidArgumentException
cl
- the parsed command line for the argumentsInvalidArgumentException
- when arguments are not validint run(org.apache.commons.cli.CommandLine cl) throws AlluxioException, IOException
cl
- the parsed command line for the argumentsAlluxioException
IOException
String getUsage()
String getDescription()
Copyright © 2023. All Rights Reserved.