Class Cli<CliFlagsT extends CliFlags>
- java.lang.Object
-
- org.apache.bookkeeper.tools.framework.Cli<CliFlagsT>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) java.lang.String
cmdPath()
protected java.io.PrintStream
console()
protected void
console(java.lang.String msg)
(package private) static <CliFlagsT extends CliFlags>
java.lang.StringgetCmdPath(CliSpec<CliFlagsT> spec)
(package private) Command
getCommand(java.lang.String command)
(package private) java.util.Map<java.lang.String,Command>
getCommandMap()
(package private) boolean
hasCommand(java.lang.String command)
(package private) java.lang.String
name()
static <CliOptsT extends CliFlags>
voidprintUsage(CliSpec<CliOptsT> spec)
(package private) boolean
run(java.lang.String[] args)
static <CliOptsT extends CliFlags>
intrunCli(CliSpec<CliOptsT> spec, java.lang.String[] args)
(package private) static <CliFlagsT extends CliFlags>
com.beust.jcommander.JCommandersetupCli(java.lang.String cmdPath, CliSpec<CliFlagsT> spec, java.util.Map<java.lang.String,Command> commandMap)
(package private) static <CliFlagsT extends CliFlags>
java.io.PrintStreamsetupConsole(CliSpec<CliFlagsT> spec)
(package private) CliSpec<CliFlagsT>
updateSpecWithDefaultValues(CliSpec<CliFlagsT> spec)
(package private) void
usage()
(package private) void
usage(java.lang.String errorMsg)
-
-
-
Method Detail
-
getCmdPath
static <CliFlagsT extends CliFlags> java.lang.String getCmdPath(CliSpec<CliFlagsT> spec)
-
setupConsole
static <CliFlagsT extends CliFlags> java.io.PrintStream setupConsole(CliSpec<CliFlagsT> spec)
-
updateSpecWithDefaultValues
CliSpec<CliFlagsT> updateSpecWithDefaultValues(CliSpec<CliFlagsT> spec)
-
name
java.lang.String name()
-
cmdPath
java.lang.String cmdPath()
-
hasCommand
boolean hasCommand(java.lang.String command)
-
getCommand
Command getCommand(java.lang.String command)
-
setupCli
static <CliFlagsT extends CliFlags> com.beust.jcommander.JCommander setupCli(java.lang.String cmdPath, CliSpec<CliFlagsT> spec, java.util.Map<java.lang.String,Command> commandMap)
-
console
protected void console(java.lang.String msg)
-
console
protected java.io.PrintStream console()
-
usage
void usage()
-
usage
void usage(java.lang.String errorMsg)
-
run
boolean run(java.lang.String[] args)
-
runCli
public static <CliOptsT extends CliFlags> int runCli(CliSpec<CliOptsT> spec, java.lang.String[] args)
-
getCommandMap
java.util.Map<java.lang.String,Command> getCommandMap()
-
-