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

Function builder

src/commands/devicepreferences.ts:56–76  ·  view source on GitHub ↗
(yargs: Argv)

Source from the content-addressed store, hash-verified

54const describe = 'list device preferences or get information for a specific device preference'
55
56const builder = (yargs: Argv): Argv<CommandArgs> =>
57 outputItemOrListBuilder(allOrganizationsBuilder(apiOrganizationCommandBuilder(yargs)))
58 .positional('id-or-index', { describe: 'the device preference id or number from list', type: 'string' })
59 .option('namespace', {
60 describe: 'a specific namespace to query; will use all by default',
61 alias: 'n',
62 type: 'string',
63 })
64 .option('standard', {
65 describe: 'show standard SmartThings device preferences',
66 alias: 's',
67 type: 'boolean',
68 default: false,
69 })
70 .example([
71 ['$0 devicepreferences', 'list all device preferences'],
72 ['$0 devicepreferences 2', 'display details for second item listed in the previous command'],
73 ['$0 devicepreferences motionSensitivity', 'display details for a preference by id'],
74 ['$0 devicepreferences --standard', 'list standard device preferences'],
75 ])
76 .epilog(buildEpilog({ command, apiDocs: ['listPreferences', 'getPreferenceById'] }))
77
78const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => {
79 const command = await apiOrganizationCommand(argv)

Callers

nothing calls this directly

Calls 3

allOrganizationsBuilderFunction · 0.85
buildEpilogFunction · 0.85

Tested by

no test coverage detected