MCPcopy Create free account
hub / github.com/SmartThingsCommunity/smartthings-cli / builder

Function builder

src/commands/locations/rooms.ts:32–50  ·  view source on GitHub ↗
(yargs: Argv)

Source from the content-addressed store, hash-verified

30const describe = 'list rooms or get information for a specific room'
31
32const 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
52const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => {
53 const command = await apiCommand(argv)

Callers

nothing calls this directly

Calls 2

apiCommandBuilderFunction · 0.85
buildEpilogFunction · 0.85

Tested by

no test coverage detected