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

Function builder

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

Source from the content-addressed store, hash-verified

30const describe = 'list modes or get information for a specific mode'
31
32const builder = (yargs: Argv): Argv<CommandArgs> =>
33 outputItemOrListBuilder(apiCommandBuilder(yargs))
34 .positional('id-or-index', { describe: 'the mode 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:modes', 'list all modes in your location(s)'],
44 [
45 '$0 locations:modes 3',
46 'display details of the third mode in the list retrieved by running "smartthings locations:modes"',
47 ],
48 ['$0 locations:modes 636169e4-8b9f-4438-a941-953b0d617231', 'display details of a mode by its id'],
49 ['$0 locations:modes --verbose', 'include location info in the output'],
50 ['$0 locations:modes --location=5dfd6626-ab1d-42da-bb76-90def3153998', 'list all modes in a particular location'],
51 ])
52 .epilog(buildEpilog({ command, apiDocs: ['getModes', 'getMode'] }))
53
54const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => {
55 const command = await apiCommand(argv)

Callers

nothing calls this directly

Calls 2

apiCommandBuilderFunction · 0.85
buildEpilogFunction · 0.85

Tested by

no test coverage detected