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

Function builder

src/commands/devices/rename.ts:23–34  ·  view source on GitHub ↗
(yargs: Argv)

Source from the content-addressed store, hash-verified

21const describe = 'rename a device'
22
23const builder = (yargs: Argv): Argv<CommandArgs> =>
24 outputItemBuilder(apiCommandBuilder(yargs))
25 .positional('id', { describe: 'device id', type: 'string' })
26 .positional('new-label', { describe: 'new device label', type: 'string' })
27 .example([
28 ['$0 devices:rename', 'prompt for a device and a new label and rename the chosen device'],
29 [
30 '$0 devices:rename f22bb71f-b6a0-43de-9131-20e7dfc0f973 "New Name"',
31 'rename the specified device with the specified name',
32 ],
33 ])
34 .epilog(buildEpilog({ command, apiDocs: ['updateDevice'] }))
35
36const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => {
37 const command = await apiCommand(argv)

Callers

nothing calls this directly

Calls 2

apiCommandBuilderFunction · 0.85
buildEpilogFunction · 0.85

Tested by

no test coverage detected