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

Function builder

src/commands/edge/drivers/devices.ts:27–51  ·  view source on GitHub ↗
(yargs: Argv)

Source from the content-addressed store, hash-verified

25const describe = 'list devices using edge drivers'
26
27const builder = (yargs: Argv): Argv<CommandArgs> =>
28 outputItemOrListBuilder(apiCommandBuilder(yargs))
29 .positional('id-or-index', { describe: 'device id or number in list', type: 'string' })
30 .option('hub', { alias: 'H', describe: 'hub id', type: 'string' })
31 .option('driver', { alias: 'D', describe: 'driver id', type: 'string' })
32 .example([
33 ['$0 edge:drivers:devices', 'list all devices using edge drivers'],
34 [
35 '$0 edge:drivers:devices 3',
36 'display details about the third device listed in the above command',
37 ],
38 [
39 '$0 edge:drivers:devices dfda0a8e-55d6-445b-ace5-db828679bcb3',
40 'display details about a device by id',
41 ],
42 [
43 '$0 edge:edge:drivers:devices --hub a9108ab1-7087-4c10-9781-a0627b084fce',
44 'list all devices using edge drivers on the specified hub',
45 ],
46 [
47 '$0 edge:drivers:devices --driver b67a134c-ace8-4b8d-9a0e-444ad78b4455',
48 'list devices that use the specified driver',
49 ],
50 ])
51 .epilog(buildEpilog({ command, apiDocs: ['getDevices', 'listDrivers', 'getDriver', 'getDriverRevision'] }))
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