Class CLI
This final class provides functionality to handle command-line arguments for various tasks (e.g., build, update, view, sequence) in the MUSIAL application. It defines options, parses arguments, validates them, and stores the parsed parameters for further processing.
The CLI class supports displaying help messages, validating input files, and managing task-specific logic through nested task classes. It ensures proper error handling and user guidance for invalid or incomplete arguments.
-
Field Summary
FieldsModifier and TypeFieldDescriptionA map to store parsed command-line parameters. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
parameters
A map to store parsed command-line parameters.This
HashMap
holds the validated and parsed parameters from the command-line arguments. The keys represent parameter names, and the values represent their corresponding values. The content of this map depends on the task being executed (e.g., build, update, view, sequence).
-
-
Constructor Details
-
CLI
public CLI()
-
-
Method Details
-
parse
Parses the command-line arguments and executes the corresponding task.This method performs the following steps:
- Determines the task to execute (e.g., BUILD, EXPAND, VIEW, SEQUENCE) and initializes the options for that task.
- Checks if the help argument (`-h` or `--help`) is provided and displays the help message if true.
- Parses the command-line arguments using the specified options and validates them.
- Transfers the parsed arguments to the appropriate task-specific logic for further processing.
MusialException
is thrown.- Parameters:
args
- An array ofString
representing the command-line arguments.- Throws:
MusialException
- If an error occurs during argument parsing or validation.
-