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 po,
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.
|
public static Map<String,String> readPasswordFileOptions(String passwordFileName, boolean withPrefix) throws CommandException
passwordFileName
- password file namewithPrefix
- decides whether prefix should be taken into accountCommandException
public static void displayClosestMatch(String commandName, String[] commands, String msg, Logger logger) throws InvalidCommandException
commandName
- commands
- msg
- logger
- InvalidCommandException
public static String[] getAllCommands(CLIContainer container, ProgramOptions po, Environment env)
container
- po
- 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
- CommandException
CommandValidationException
public static void writeCommandToDebugLog(String cname, Environment env, String[] args, int exit)
cname
- env
- args
- exit
- Copyright © 2018. All rights reserved.