Command.findCommand

Searches for a subcommand with the specified name.

This function can search either the immediate subcommands of this command or recursively within a specified subcommand tree.

class Command
const nothrow @safe
const(Command)
findCommand
(
string name
,
const(Command) root = null
)

Parameters

name string

The name of the subcommand to search for.

root const(Command)

Optional. The command node to start the search from. - If null, the search is performed only among this command’s immediate subcommands. - If non-null, the search is recursive starting from root and checks all nested subcommands.

Return Value

Type: const(Command)

The first Command matching the specified name, or null if no match is found.