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

Function builder

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

Source from the content-addressed store, hash-verified

22const describe = 'list locations or get information for a specific location'
23
24const builder = (yargs: Argv): Argv<CommandArgs> =>
25 outputItemOrListBuilder(apiCommandBuilder(yargs))
26 .positional('id-or-index', { describe: 'the location id or number in list', type: 'string' })
27 .example([
28 ['$0 locations', 'list all locations'],
29 ['$0 locations 1', 'display details for the first location in the list retrieved by running "smartthings locations"'],
30 ['$0 locations 5dfd6626-ab1d-42da-bb76-90def3153998', 'display details for a location by id'],
31 ])
32 .epilog(buildEpilog({ command, apiDocs: ['listLocations', 'getLocation'] }))
33
34const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => {
35 const command = await apiCommand(argv)

Callers

nothing calls this directly

Calls 2

apiCommandBuilderFunction · 0.85
buildEpilogFunction · 0.85

Tested by

no test coverage detected