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

Function builder

src/commands/locations/modes/getcurrent.ts:31–51  ·  view source on GitHub ↗
(yargs: Argv)

Source from the content-addressed store, hash-verified

29const describe = 'get details of current mode'
30
31const builder = (yargs: Argv): Argv<CommandArgs> =>
32 formatAndWriteItemBuilder(apiCommandBuilder(yargs))
33 .positional('id', { describe: 'mode id', type: 'string' })
34 .option('location', { alias: 'l', describe: 'a specific location to query', type: 'string' })
35 .option('verbose',
36 { alias: 'v', describe: 'include location name in output', type: 'boolean', default: false })
37 .example([
38 [
39 '$0 locations:modes:getcurrent',
40 'get details of current mode, prompting for a location if there are more than one',
41 ],
42 [
43 '$0 locations:modes:getcurrent --verbose',
44 'include location name and id in the output',
45 ],
46 [
47 '$0 locations:modes:getcurrent --location 5dfd6626-ab1d-42da-bb76-90def3153998',
48 'get the current mode for a specified location',
49 ],
50 ])
51 .epilog(buildEpilog({ command, apiDocs: 'getCurrentMode' }))
52
53const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => {
54 const command = await apiCommand(argv)

Callers

nothing calls this directly

Calls 2

apiCommandBuilderFunction · 0.85
buildEpilogFunction · 0.85

Tested by

no test coverage detected