runWithOutput method
Future<void>
runWithOutput(
- Configuration<
StatusLiveOption> commandConfig, - CommandOutput output
override
Runs this command with prepared configuration and output.
Subclasses should override this method.
Implementation
@override
Future<void> runWithOutput(
final Configuration<StatusLiveOption> commandConfig,
final CommandOutput output,
) async {
final projectId = commandConfig.value(StatusLiveOption.projectId);
final inUtc = commandConfig.value(StatusLiveOption.utc);
final watch = commandConfig.value(StatusLiveOption.watch);
final interval = commandConfig.value(StatusLiveOption.interval);
final client = runner.serviceProvider.cloudApiClient;
if (watch) {
await renderCommand(
output,
operation: () async => StatusCommands.watchRuntimeStatus(
client,
projectId: projectId,
interval: interval,
stop: logger.inlineTerminal.interruptSignals,
),
textOutputUi: RuntimeStatusWatchTextUi(
baseCommand: baseCommand,
utc: inUtc,
interval: interval,
),
);
return;
}
if (commandConfig.valueSourceType(StatusLiveOption.interval) ==
ValueSourceType.arg) {
logger.warning('The --interval option has no effect without --watch.');
}
await renderCommand(
output,
operation: () =>
StatusCommands.fetchRuntimeStatus(client, projectId: projectId),
textOutputUi: RuntimeStatusTextUi(baseCommand: baseCommand, utc: inUtc),
);
}