function runTool(platform, args, done) {
  var argv = optimist
    .usage('Generate a standalone native WebGL app.\nUsage: $0 source.wtf-trace [output.exe]')
    .options('debug', {
      type: 'boolean',
      default: false,
      desc: 'Debug mode.'
    })
    .options('output', {
      type: 'string',
      default: null,
      desc: 'Output path for executables/data. Defaults to the path of the input file.'
    })
    .options('src_output', {
      type: 'string',
      default: null,
      desc: 'Output path for source files. Defaults to temp.'
    })
    .options('use_angle', {
      type: 'boolean',
      default: false,
      desc: 'Use ANGLE on Windows instead of native GL.'
    })
    .options('vs_config', {
      type: 'string',
      default: 'Release',
      desc: 'Visual Studio configuration to build (Debug/Release).'
    })
    .options('vs_platform', {
      type: 'string',
      default: 'x86',
      desc: 'Visual Studio platform to build (x86/x64).'
    })
    .options('vs_deps', {
      type: 'string',
      default: 'C:\\Dev\\tf-deps\\',
      desc: 'Path to search for dependency includes/libs.'
    })
    .check(function(argv) {
      if (argv['help']) {
        throw '';
      }
      // Assert has a file.
      if (!argv._.length) {
        throw 'Pass a trace file to process.'
      }
      return true;
    })
    .argv;

  if (argv['debug']) {
    goog.require('wtf.replay.graphics.Step');
  }

  var inputFile = path.resolve(argv._[0]);
  var outputBaseFile =
      path.join(argv._[1] || argv['output'] || path.dirname(inputFile),
                path.basename(inputFile, '.wtf-trace'));
  if (!fs.existsSync(path.dirname(outputBaseFile))) {
    fs.mkdirSync(path.dirname(outputBaseFile));
  }

  console.log('Processing ' + inputFile + '...');
  console.log('');

  wtf.db.load(inputFile, function(db) {
    if (db instanceof Error) {
      console.log('ERROR: unable to open ' + inputFile, db, db.stack);
      done(1);
    } else {
      processDatabase(argv, outputBaseFile, db, done);
    }
  });
}
@fileoverview Generate a standalone native WebGL app.
Given an input trace file (with recorded WebGL calls) this app will build a
standalone native executable that issues those calls directly to OpenGL.

@author benvanik@google.com (Ben Vanik)