(yargs: Argv)
| 28 | const describe = 'get a specific rule or a list of rules' |
| 29 | |
| 30 | const builder = (yargs: Argv): Argv<CommandArgs> => |
| 31 | outputItemOrListBuilder(apiCommandBuilder(yargs)) |
| 32 | .positional('id-or-index', { describe: 'the rule id or number from list', type: 'string' }) |
| 33 | .option('location', { |
| 34 | alias: 'l', |
| 35 | describe: 'a specific location to query', |
| 36 | type: 'string', |
| 37 | }) |
| 38 | .example([ |
| 39 | ['$0 rules', 'list all rules'], |
| 40 | ['$0 rules 1', 'display details for the first rule in the list retrieved by running "smartthings rules"'], |
| 41 | ['$0 rules 5dfd6626-ab1d-42da-bb76-90def3153998', 'display details for an rule by id'], |
| 42 | ]) |
| 43 | .epilog(buildEpilog({ command, apiDocs: ['listRules', 'getRule'] })) |
| 44 | |
| 45 | const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => { |
| 46 | const command = await apiCommand(argv) |
nothing calls this directly
no test coverage detected