Package ffx.utilities
Class FFXCommand
java.lang.Object
ffx.utilities.FFXCommand
- Direct Known Subclasses:
PotentialCommand
Base Command class.
- Author:
- Michael J. Schnieders
-
Field Summary
Modifier and TypeFieldDescriptionString[]
The array of args passed into the Script.final picocli.CommandLine.Help.Ansi
Unix shells are able to evaluate PicoCLI ANSI color codes, but right now the FFX GUI Shell does not.boolean
-h or --help Prints a help message.static final Logger
The logger for this class.picocli.CommandLine.ParseResult
Parse Result.boolean
-V or --version Prints the FFX version and exits. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Class
<? extends FFXCommand> getCommand
(String name) Use the System ClassLoader to find the requested command.Obtain the Context for this command.Default help information.boolean
init()
Initialize this Script based on the specified command line arguments.static void
listCommands
(boolean logCommands, boolean logTestCommands) List the embedded FFX Groovy Scripts.run()
Execute the command.
-
Field Details
-
logger
The logger for this class. -
color
public final picocli.CommandLine.Help.Ansi colorUnix shells are able to evaluate PicoCLI ANSI color codes, but right now the FFX GUI Shell does not.In a headless environment, color will be ON for command line help, but OFF for the GUI.
-
args
The array of args passed into the Script. -
parseResult
public picocli.CommandLine.ParseResult parseResultParse Result. -
version
public boolean version-V or --version Prints the FFX version and exits. -
help
public boolean help-h or --help Prints a help message.
-
-
Constructor Details
-
FFXCommand
Default constructor for an FFX Script.- Parameters:
ffxContext
- aFFXContext
object
-
-
Method Details
-
getFfxContext
Obtain the Context for this command.- Returns:
- The FFXContext.
-
getCommand
Use the System ClassLoader to find the requested command.- Parameters:
name
- Name of the script to load (e.g. Energy).- Returns:
- The Script, if found, or null.
-
listCommands
public static void listCommands(boolean logCommands, boolean logTestCommands) List the embedded FFX Groovy Scripts.- Parameters:
logCommands
- List Scripts.logTestCommands
- List Test Scripts.
-
helpString
Default help information.- Returns:
- String describing how to use this command.
-
init
public boolean init()Initialize this Script based on the specified command line arguments.- Returns:
- boolean Returns true if the script should continue and false to exit.
-
run
Execute the command.- Returns:
- a
FFXCommand
object
-