public class CLIUtil extends Object
| Constructor and Description |
|---|
CLIUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
displayClosestMatch(String commandName,
String[] commands,
String msg,
Logger logger)
Display the commands from the list that are the closest match
to the specified command.
|
static String[] |
getAllCommands(CLIContainer container,
ProgramOptions options,
Environment env)
Return all commands, local and remote.
|
static String[] |
getLocalCommands(CLIContainer container)
Get all the known local commands.
|
static String[] |
getRemoteCommands(CLIContainer container,
ProgramOptions po,
Environment env)
Get the list of commands from the remote server.
|
static Map<String,String> |
readPasswordFileOptions(String passwordFileName,
boolean withPrefix)
Read passwords from the password file and save them in a java.util.Map.
|
static void |
writeCommandToDebugLog(String cname,
Environment env,
String[] args,
int exit)
Log the command, for debugging.
|
protected static final Logger LOGGER
public static Map<String,String> readPasswordFileOptions(String passwordFileName, boolean withPrefix) throws CommandException
passwordFileName - password file namewithPrefix - decides whether prefix should be taken into accountCommandExceptionpublic static void displayClosestMatch(String commandName, String[] commands, String msg, Logger logger) throws InvalidCommandException
commandName - commands - msg - logger - InvalidCommandExceptionpublic static String[] getAllCommands(CLIContainer container, ProgramOptions options, Environment env)
container - options - Options to get the command i.e. admin portenv - public static String[] getLocalCommands(CLIContainer container)
container - public static String[] getRemoteCommands(CLIContainer container, ProgramOptions po, Environment env) throws CommandException, CommandValidationException
container - po - Options to get the command i.e. admin portenv - CommandExceptionCommandValidationExceptionpublic static void writeCommandToDebugLog(String cname, Environment env, String[] args, int exit)
cname - env - args - exit - Copyright © 2019. All rights reserved.