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

Function builder

src/commands/rules/update.ts:33–51  ·  view source on GitHub ↗
(yargs: Argv)

Source from the content-addressed store, hash-verified

31const describe = 'update a rule'
32
33const builder = (yargs: Argv): Argv<CommandArgs> =>
34 inputAndOutputItemBuilder(apiCommandBuilder(yargs))
35 .positional('id', { describe: 'rule id', type: 'string' })
36 .option('location', {
37 alias: 'l',
38 describe: 'a specific location to query',
39 type: 'string',
40 })
41 .example([
42 [
43 '$0 rules:update -i my-rule.yaml',
44 'prompt for a rule and update it using the data in "my-rule.yaml"',
45 ],
46 [
47 '$0 rules:update 392bcb11-e251-44f3-b58b-17f93015f3aa -i my-rule.json',
48 'update the rule with the given id using the data in "my-rule.json"',
49 ],
50 ])
51 .epilog(buildEpilog({ command, apiDocs: ['updateRule'] }))
52
53const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => {
54 const command = await apiCommand(argv)

Callers

nothing calls this directly

Calls 3

apiCommandBuilderFunction · 0.85
buildEpilogFunction · 0.85

Tested by

no test coverage detected