interface CommandRegistry

Interface used by a CLI to register Command instances.

Methods

getSubCommands(): ReadonlyArray<SubCommand>

Get all registered SubCommand instances.

Get all registered GroupCommand instances.

Get all registered GlobalCommand instances.

Get all registered GlobalModifierCommand instances.

getSubCommandByName(name: string): SubCommand | undefined

Get a registered SubCommand by name.

getGroupCommandByName(name: string): GroupCommand | undefined

Get a registered GroupCommand by name.

getGroupCommandAndMemberSubCommandByJoinedName(getGroupCommandAndMemberSubCommandByName: string): { groupCommand: GroupCommand; command: SubCommand; } | undefined

Get a registered GroupCommand and member SubCommand by combined name e.g. <group-command-name>:<member-sub-command-name>.

getGlobalCommandByName(name: string): GlobalCommand | undefined

Get a registered GlobalCommand by name.

Get a registered GlobalModifierCommand by name.

getGroupAndMemberCommandsByJoinedName(): ReadonlyMap<string, { groupCommand: GroupCommand; command: SubCommand; }>

Get a map of all registered GroupCommand and member SubCommand instance combinations by combined name e.g. <group-command-name>:<member-sub-command-name>.

Get a map of all registered GlobalModifierCommand instances by name provided by the specified service.

Get a map of all registered GlobalModifierCommand instances by short alias provided by the specified service.

Get a map of all registered GlobalModifierCommand instances by name not provided by a service.

Get a map of all registered GlobalModifierCommand instances by short alias not provided by a service.

getNonModifierCommandsByName(): ReadonlyMap<string, Command>

Get a map of all registered non-modifier Command instances by name.

Get a map of all registered GlobalCommand instances by short alias.