(argv: ArgumentsCamelCase<CommandArgs>)
| 43 | .epilog(buildEpilog({ command, apiDocs: ['listRules', 'getRule'] })) |
| 44 | |
| 45 | const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => { |
| 46 | const command = await apiCommand(argv) |
| 47 | |
| 48 | const config: OutputItemOrListConfig<Rule & WithNamedLocation> = { |
| 49 | primaryKeyName: 'id', |
| 50 | sortKeyName: 'name', |
| 51 | listTableFieldDefinitions: ['name', 'id', 'locationId', 'location'], |
| 52 | tableFieldDefinitions, |
| 53 | } |
| 54 | |
| 55 | await outputItemOrList( |
| 56 | command, |
| 57 | config, |
| 58 | argv.idOrIndex, |
| 59 | () => getRulesByLocation(command.client, argv.location), |
| 60 | id => getRuleWithLocation(command.client, id, argv.location), |
| 61 | ) |
| 62 | } |
| 63 | |
| 64 | const cmd: CommandModule<object, CommandArgs> = { command, describe, builder, handler } |
| 65 | export default cmd |
nothing calls this directly
no test coverage detected