CommandLineInterface class
The command line interface service is used to inject the CLI commands of your applications and packages used by the cli.
final cli = CommandLineInterface(packages: [
SomePackage()
]);
await cli.handle(arguments);
NOTE : All commands are automatically registered into the help command.
NOTE : Used packages should extend the MineralPackageContract contracts.
Constructors
-
CommandLineInterface({List<
MineralPackageContract> packages = const []})
Properties
- console → ConsoleService
-
The
ConsoleService
used to display messages in the consoleno setter - hashCode → int
-
The hash code for this object.
no setterinherited
-
packages
→ List<
MineralPackageContract> -
List of packages used by the cli
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
handle(
List< String> arguments) → Future<void> - Handle the command line arguments to execute the given entry command.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
register(
List< CliCommandContract> commands) → void - Register your commands into the command line interface service.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited