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

Function builder

src/commands/rules.ts:30–43  ·  view source on GitHub ↗
(yargs: Argv)

Source from the content-addressed store, hash-verified

28const describe = 'get a specific rule or a list of rules'
29
30const builder = (yargs: Argv): Argv<CommandArgs> =>
31 outputItemOrListBuilder(apiCommandBuilder(yargs))
32 .positional('id-or-index', { describe: 'the rule id or number from list', type: 'string' })
33 .option('location', {
34 alias: 'l',
35 describe: 'a specific location to query',
36 type: 'string',
37 })
38 .example([
39 ['$0 rules', 'list all rules'],
40 ['$0 rules 1', 'display details for the first rule in the list retrieved by running "smartthings rules"'],
41 ['$0 rules 5dfd6626-ab1d-42da-bb76-90def3153998', 'display details for an rule by id'],
42 ])
43 .epilog(buildEpilog({ command, apiDocs: ['listRules', 'getRule'] }))
44
45const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => {
46 const command = await apiCommand(argv)

Callers

nothing calls this directly

Calls 2

apiCommandBuilderFunction · 0.85
buildEpilogFunction · 0.85

Tested by

no test coverage detected