(yargs: Argv)
| 30 | const describe = 'list rooms or get information for a specific room' |
| 31 | |
| 32 | const builder = (yargs: Argv): Argv<CommandArgs> => |
| 33 | outputItemOrListBuilder(apiCommandBuilder(yargs)) |
| 34 | .positional('id-or-index', { describe: 'the room id or number in list', type: 'string' }) |
| 35 | .option('location', { |
| 36 | alias: 'l', |
| 37 | describe: 'a specific location to query', |
| 38 | type: 'string', |
| 39 | }) |
| 40 | .option('verbose', |
| 41 | { alias: 'v', describe: 'include location name in output', type: 'boolean', default: false }) |
| 42 | .example([ |
| 43 | ['$0 locations:rooms', 'list all rooms'], |
| 44 | [ |
| 45 | '$0 locations:rooms 1', |
| 46 | 'display details for the first room in the list retrieved by running "smartthings locations:rooms"', |
| 47 | ], |
| 48 | ['$0 locations:rooms 5dfd6626-ab1d-42da-bb76-90def3153998', 'display details for a room by id'], |
| 49 | ]) |
| 50 | .epilog(buildEpilog({ command, apiDocs: ['listRooms', 'getRoom'] })) |
| 51 | |
| 52 | const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => { |
| 53 | const command = await apiCommand(argv) |
nothing calls this directly
no test coverage detected