(argv: ArgumentsCamelCase<CommandArgs>)
| 46 | .epilog(buildEpilog({ command, apiDocs: ['getDeviceComponentStatus'] })) |
| 47 | |
| 48 | const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => { |
| 49 | const command = await apiCommand(argv) |
| 50 | |
| 51 | const deviceId = await chooseDevice(command, argv.deviceIdOrIndex, { allowIndex: true }) |
| 52 | |
| 53 | const device = await command.client.devices.get(deviceId) |
| 54 | const componentName = await chooseComponentFn(device)( |
| 55 | command, |
| 56 | argv.componentId, |
| 57 | { autoChoose: true, allowIndex: true }, |
| 58 | ) |
| 59 | |
| 60 | const componentStatus = await command.client.devices.getComponentStatus(deviceId, componentName) |
| 61 | await formatAndWriteItem( |
| 62 | command, |
| 63 | { buildTableOutput: data => buildComponentStatusTableOutput(command.tableGenerator, data) }, |
| 64 | componentStatus, |
| 65 | ) |
| 66 | } |
| 67 | |
| 68 | const cmd: CommandModule<object, CommandArgs> = { command, describe, builder, handler } |
| 69 | export default cmd |
nothing calls this directly
no test coverage detected