chassis_forge library
A collection of CLI helpers for assisting with Project focused task automation
Classes
- ChassisCommand
-
Chassis Command Boilerplate extends SmartArgCommand to print usage if
requested. Otherwise, invokes run with IShell obtained from the global
GetIt
instance and parent SmartArg arguments. - ChassisForge
-
since 0.0.1
- IShell
- A marker interface representing a basic Shell to run and evaluate commands
- IShellCommandBuilder
- PipedProcessResult
- The result of running a non-interactive, piped process started with Process.run or Process.runSync.
- ProcessRunShell
- A Basic implementation of IShell using package:process_run
- ShellCommandBuilder
Mixins
- HelpArg
- A basic mixin for adding a the help argument to each SmartArg extension
- VerboseArg
- A basic mixin for adding a the help argument to each SmartArg extension
Extensions
Properties
- loggingConfigured ↔ bool
-
True if an
Logger.root.onRecord
listener has been attachedgetter/setter pair
Functions
-
configureLogger(
dynamic level) → void -
Configures Logging to the specified
level
since 0.0.1
-
getShell(
SmartArg context) → IShell - Gets the IShell instance for the current SmartArg context. If not found, the SmartArg.parent will be recursively searched until a ChassisForge instance is found.
-
hasCommand(
IShell shell, String command) → bool - True if the command exists. Logs a Warning if the command is not found
-
shellArgument(
String argument) → String - Use to safely enclose an argument if needed
-
shellArguments(
List< String> arguments) → String - Convert multiple arguments to string than can be used in a terminal
Exceptions / Errors
- BlankCommandException
- Exception thrown when no commands to run have been detected
- ChassisShellException
- Exception thrown when a Command is not found within the $PATH
- CommandException
- A marker interface implemented by all Command Execution exceptions
- CommandNotFoundException
- Exception thrown when a Command is not found within the $PATH
- MultipleScriptCommandException
- Exception thrown when multiple commands to be run have been detected
- PipedCommandResultException
- Exception thrown when any piped process exists with a non-zero exit code