(yargs: Argv)
| 29 | const describe = 'list all drivers installed on a given hub' |
| 30 | |
| 31 | const builder = (yargs: Argv): Argv<CommandArgs> => |
| 32 | outputItemOrListBuilder(apiCommandBuilder(yargs)) |
| 33 | .positional('id-or-index', { describe: 'driver id or number in list', type: 'string' }) |
| 34 | .option('hub', { alias: 'H', describe: 'hub id', type: 'string' }) |
| 35 | .option('device', { describe: 'include only drivers matching the device', type: 'string' }) |
| 36 | .option('verbose', { alias: 'v', describe: 'include channel name in output', type: 'boolean', default: false }) |
| 37 | .example([ |
| 38 | ['$0 smartthings edge:drivers:installed', 'list all installed drivers'], |
| 39 | [ |
| 40 | '$0 smartthings edge:drivers:installed --verbose', |
| 41 | 'list all installed drivers and include the channel name in the output', |
| 42 | ], |
| 43 | [ |
| 44 | '$0 smartthings edge:drivers:installed 1', |
| 45 | 'list the first driver in the list retrieved by running "smartthings edge:drivers:installed', |
| 46 | ], |
| 47 | [ |
| 48 | '$0 smartthings edge:drivers:installed 3f9f151d-3022-4b9f-814a-afcbf69b650f', |
| 49 | 'display details for an installed driver by id', |
| 50 | ], |
| 51 | ]) |
| 52 | .epilog(buildEpilog({ command, apiDocs: ['listHubInstalledDrivers', 'getHubDeviceDriver'] })) |
| 53 | |
| 54 | const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => { |
| 55 | const command = await apiCommand(argv) |
nothing calls this directly
no test coverage detected