Package org.daiitech.naftah
Class Naftah.NaftahCommand
java.lang.Object
org.daiitech.naftah.Naftah.NaftahCommand
- Direct Known Subclasses:
Naftah.NaftahCommand.InitCommand,Naftah.NaftahCommand.ManualCommand,Naftah.NaftahCommand.RunCommand,Naftah.NaftahCommand.ShellCommand
- Enclosing class:
- Naftah
The base command class for the Naftah CLI, implemented with picocli.
Supports subcommands: run, init, and shell.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classThe 'init' subcommand that prepares Java classpath classes for Naftah reuse.private static final classThe'man'subcommand for Naftah.private static final classThe 'run' subcommand that interprets a Naftah script.private static final classThe 'shell' subcommand that starts the interactive Naftah REPL (Read-Eval-Print Loop). -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanprocess(picocli.CommandLine.ParseResult parseResult, Naftah.NaftahCommand matchedCommand) Processes the parsed command line arguments and configures the environment.protected voidRuns the command.
-
Field Details
-
NAME
The main command name.- See Also:
-
arguments
-
enabledCaches
-
systemProperties
-
classpath
-
debug
private boolean debug -
encoding
-
scanClasspath
private boolean scanClasspath -
forceScanClasspath
private boolean forceScanClasspath -
script
-
helpRequested
private boolean helpRequested -
versionRequested
private boolean versionRequested -
useVectorApi
private boolean useVectorApi -
useNumberFormatter
private boolean useNumberFormatter -
useArabicIndic
private boolean useArabicIndic -
loadClassesAndFunctions
private boolean loadClassesAndFunctions
-
-
Constructor Details
-
NaftahCommand
private NaftahCommand()
-
-
Method Details
-
run
Runs the command.- Parameters:
main- the main Naftah instancebootstrapAsync- whether to bootstrap asynchronously- Throws:
Exception- if any error occurs
-
process
private boolean process(picocli.CommandLine.ParseResult parseResult, Naftah.NaftahCommand matchedCommand) throws picocli.CommandLine.ParameterException Processes the parsed command line arguments and configures the environment.- Parameters:
parseResult- the parsed command line resultmatchedCommand- the matched command- Returns:
- true if processing succeeded; false otherwise
- Throws:
picocli.CommandLine.ParameterException- if the command line is invalid
-