(config: CommandConfig)
| 123 | * }) |
| 124 | */ |
| 125 | export function defineCommand(config: CommandConfig): CommandDefinition { |
| 126 | return { |
| 127 | name: config.name, |
| 128 | aliases: config.aliases ?? [], |
| 129 | acceptsArgs: false, |
| 130 | handler: (params) => { |
| 131 | // Args are gracefully ignored for commands that don't accept them |
| 132 | return config.handler(params) |
| 133 | }, |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | /** |
| 138 | * Factory for commands that accept arguments. |
no outgoing calls
no test coverage detected