CommandListOps extension
Extension methods for manipulating command lists.
Provides fluent operations for building derived tool definitions via ToolDefinition.copyWith.
final commands = baseTool.commands
.without({'dcli', 'findproject'})
.replacing('runner', myCustomRunner)
.plus([newCommand]);
Methods
-
plus(
List< CommandDefinition> additions) → List<CommandDefinition> -
Available on List<
Return a new list withCommandDefinition> , provided by the CommandListOps extensionadditionsappended. -
replacing(
String name, CommandDefinition replacement) → List< CommandDefinition> -
Available on List<
Return a new list with the named command replaced (keeps position).CommandDefinition> , provided by the CommandListOps extension -
without(
Set< String> names) → List<CommandDefinition> -
Available on List<
Return a new list with the named commands removed.CommandDefinition> , provided by the CommandListOps extension