run method

  1. @override
Future<int> run()
override

Runs this command.

The return value is wrapped in a Future if necessary and returned by CommandRunner.runCommand.

Implementation

@override
Future<int> run() async {
  final id = argResults!['id'] as String;
  final key = argResults!['key'] as String;
  final pId = await requireProjectIdAsync();

  final client = container.read(translationServiceClientProvider);
  final result = await client.copyTranslation(
    CopyTranslationRequest(
      id: id,
      projectId: pId,
      key: key,
    ),
    options: getCallOptions(requireUser: false),
  );
  printOutput(result);
  return 0;
}