parseSourcemapCommand function

void parseSourcemapCommand(
  1. ArgResults command,
  2. bool verbose
)

Implementation

void parseSourcemapCommand(ArgResults command, bool verbose) {
  if (command.wasParsed('help')) {
    print('Usage: raygun-cli sourcemap <arguments>');
    print(buildParserSourcemap().usage);
    exit(0);
  }
  if (!command.wasParsed('app-id') || !command.wasParsed('token')) {
    print('Missing mandatory arguments');
    print(buildParserSourcemap().usage);
    exit(2);
  }
  switch (command.option('platform')) {
    case null:
      SourcemapSingleFile(command: command, verbose: verbose).upload();
    case 'flutter':
      SourcemapFlutter(command: command, verbose: verbose).upload();
    case 'node':
      SourcemapNode(command: command, verbose: verbose).upload();
    default:
      print('Unsupported platform');
      exit(1);
  }
}