allCommandsInNamespace method

Map<String, Command> allCommandsInNamespace(
  1. String namespace
)
inherited

Returns all commands whose full name starts with namespace followed by namespaceSeparator.

For example, allCommandsInNamespace('cache') returns cache:clear, cache:forget, etc.

This is equivalent to Symfony Console's Application::all($namespace).

Implementation

Map<String, args_pkg.Command<T>> allCommandsInNamespace(String namespace) {
  final prefix = '$namespace$namespaceSeparator';
  return {
    for (final entry in commands.entries)
      if (entry.key.startsWith(prefix)) entry.key: entry.value,
  };
}