java.lang.Object
org.apache.bookkeeper.tools.framework.CliCommand<GlobalFlagsT,CommandFlagsT>
- All Implemented Interfaces:
Command<GlobalFlagsT>
- Direct Known Subclasses:
BKCommand,CliCommandGroup
public class CliCommand<GlobalFlagsT extends CliFlags,CommandFlagsT extends CliFlags>
extends Object
implements Command<GlobalFlagsT>
A command that runs a CLI spec. it is typically used for nested sub commands.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply(GlobalFlagsT globalFlags, String[] args) Process the command.category()Return category of this command belongs to.Return description name.getUsage()name()Return command name.path()Return command path in a cli path.voidvoidusage()Print the help information.
-
Field Details
-
spec
-
-
Constructor Details
-
CliCommand
-
-
Method Details
-
setParent
-
category
Description copied from interface:CommandReturn category of this command belongs to.- Specified by:
categoryin interfaceCommand<GlobalFlagsT extends CliFlags>- Returns:
- category name
-
name
Description copied from interface:CommandReturn command name.- Specified by:
namein interfaceCommand<GlobalFlagsT extends CliFlags>- Returns:
- command name.
-
path
Description copied from interface:CommandReturn command path in a cli path.This is used for printing usage information.
- Specified by:
pathin interfaceCommand<GlobalFlagsT extends CliFlags>- Returns:
- command path
-
description
Description copied from interface:CommandReturn description name.- Specified by:
descriptionin interfaceCommand<GlobalFlagsT extends CliFlags>- Returns:
- description name.
-
apply
Description copied from interface:CommandProcess the command.- Specified by:
applyin interfaceCommand<GlobalFlagsT extends CliFlags>args- command args- Returns:
- true if successfully apply the args, otherwise false
-
usage
public void usage()Description copied from interface:CommandPrint the help information.- Specified by:
usagein interfaceCommand<GlobalFlagsT extends CliFlags>
-
getUsage
-