Command constructor

Command({
  1. required String use,
  2. required String description,
  3. required FutureOr<Response> run(
    1. CommandInformation context
    ),
  4. bool inheritFlags = false,
  5. bool hidden = false,
  6. List<Flag> flags = const [],
  7. List<Command> subCommands = const [],
})

Instantiates a command with the given values. A command is an action, callable inside the cli.

Implementation

Command({
  required this.use,
  required this.description,
  required this.run,
  this.inheritFlags = false,
  this.hidden = false,
  this.flags = const [],
  this.subCommands = const [],
}) {
  if (use.length > 15) {
    throw Exception(
      "The usage of a command shouldn't be longer than 15 characters.",
    );
  }
}