Package ffx.utilities
Class FFXCommand
java.lang.Object
ffx.utilities.FFXCommand
- Direct Known Subclasses:
AlgorithmsCommand,PotentialCommand
Base FFX Command class.
- Author:
- Michael J. Schnieders
-
Field Summary
FieldsModifier and TypeFieldDescriptionString[]The array of args passed into the Script.The Binding that provides variables to this Command.final picocli.CommandLine.Help.AnsiUnix 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 LoggerThe logger for this class.picocli.CommandLine.ParseResultParse Result.boolean-V or --version Prints the FFX version and exits. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for an FFX Command.FFXCommand(FFXBinding binding) Default constructor for an FFX Command.FFXCommand(String[] args) Create an FFX Command using the supplied command line arguments. -
Method Summary
Modifier and TypeMethodDescriptionstatic Class<? extends FFXCommand> getCommand(String name) Use the System ClassLoader to find the requested Command.Default help information.booleaninit()Initialize this Command based on the specified command line arguments.static voidlistCommands(boolean logCommands, boolean logTestCommands) List the embedded FFX Commands.run()Execute this Command.voidsetBinding(FFXBinding binding) Set the Binding that provides variables to this 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. -
binding
The Binding that provides variables to this Command.
-
-
Constructor Details
-
FFXCommand
public FFXCommand()Default constructor for an FFX Command. -
FFXCommand
Create an FFX Command using the supplied command line arguments.- Parameters:
args- The command line arguments.
-
FFXCommand
Default constructor for an FFX Command.- Parameters:
binding- the Binding that provides variables to this Command.
-
-
Method Details
-
setBinding
Set the Binding that provides variables to this Command.- Parameters:
binding- The Binding to use.
-
getCommand
Use the System ClassLoader to find the requested Command.- Parameters:
name- Name of the Command to load (e.g., Energy).- Returns:
- The Command, if found, or null.
-
listCommands
public static void listCommands(boolean logCommands, boolean logTestCommands) List the embedded FFX Commands.- Parameters:
logCommands- List Commands.logTestCommands- List Test Commands.
-
helpString
Default help information.- Returns:
- String describing how to use this command.
-
init
public boolean init()Initialize this Command based on the specified command line arguments.- Returns:
- boolean Returns true if the script should continue and false to exit.
-
run
Execute this Command.- Returns:
- The current FFXCommand.
-