(argv: ArgumentsCamelCase<CommandArgs>)
| 33 | .epilog(buildEpilog({ command, apiDocs: 'uninstallDriver' })) |
| 34 | |
| 35 | const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => { |
| 36 | const command = await apiCommand(argv) |
| 37 | |
| 38 | const hubId = await chooseHubFn({ withInstalledDriverId: argv.driverId })( |
| 39 | command, |
| 40 | argv.hub, |
| 41 | { promptMessage: 'Select a hub to uninstall from.' }, |
| 42 | ) |
| 43 | |
| 44 | const listInstalledDrivers = (): Promise<InstalledDriver[]> => command.client.hubdevices.listInstalled(hubId) |
| 45 | const driverId = await chooseDriver( |
| 46 | command, |
| 47 | argv.driverId, |
| 48 | { promptMessage: 'Select a driver to uninstall.', listItems: listInstalledDrivers }, |
| 49 | ) |
| 50 | await command.client.hubdevices.uninstallDriver(driverId, hubId) |
| 51 | console.log(`Driver ${driverId} uninstalled from hub ${hubId}.`) |
| 52 | } |
| 53 | |
| 54 | const cmd: CommandModule<object, CommandArgs> = { command, describe, builder, handler } |
| 55 | export default cmd |
nothing calls this directly
no test coverage detected