Dump tool.
@param {!wtf.pal.IPlatform} platform Platform abstraction layer.
@param {!Array.<string>} args Command line arguments.
@param {function(number)} done Call to end the program with a return code.
332764
function runTool(platform, args_, done) {
  var args = optimist.argv;
  var allzones = args['allzones'];

  var inputFile = args['_'][0];
  if (!inputFile) {
    console.log('usage: dump.js [--allzones] file.wtf-trace');
    done(1);
    return;
  }
  console.log('Dumping ' + 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 {
      done(dumpDatabase(db, allzones));
    }
  });
}
314493
function (done) {
        glob(path.join(__dirname, "*.ejs"), function (err, files) {
            if (err) {
                return done(err);
            }

            var templates = {};

            async.forEach(files, function (file, done) {
                fs.readFile(file, "utf8", function (err, data) {
                    if (err) {
                        return done(err);
                    } else {
                        templates[path.basename(file, ".ejs")] = _.template(data);
                        done();
                    }
                });
            }, function (err) {
                if (err) {
                    return done(err);
                }

                done(null, templates);
            });
        });
    }
904481
function downloadProjectCompilation(project, platform, outputDir) {
	return waitForCompletion(project)
	.then(() => {
		if (project.compilations[platform]) {
			if (project.compilations[platform].isReady()) {
				return downloadFile(project.compilations[platform].downloadLink,
					outputDir + "/" + project.name + "-" + platform + ".zip")
				.catch((error) => {
					console.error("Couldn't download " + platform + " compilation from project " + project.id + ".");
					console.trace(error);
					throw error;
				});
			} else if (project.compilations[platform].isErred()) {
				console.error("Couldn't download " + platform + " compilation from " + project.name + " project: " + project.id +
					". The compilation failed.");
				throw new Error("Compilation failed");
			} else {
				console.error("Couldn't download " + platform + " compilation from " + project.name + " project: " + project.id +
					". Status: " + project.compilations[platform].status + ".");
				throw new Error("Platform ignored");
			}
		} else {
			console.error("Couldn't download " + platform + " compilation from " + project.name + " project: " + project.id +
				". There was not a compilation issued for the platform.");
			throw new Error("No compilation available");
		}
	})
	.catch((error) => {
		console.trace(error);
		throw error;
	});
}
742342
function generate (projectPatch, source, done) {
  shell.mkdir('-p', projectPatch)
  shell.cp('-Rf', source, projectPatch)
  done()
}
913045
def dump
      puts '******************'
      puts '* RakeOE::Config *'
      puts '******************'
      puts "Directories                 : #{@directories}"
      puts "Suffixes                    : #{@suffixes}"
      puts "Platform                    : #{@platform}"
      puts "Release mode                : #{@release}"
      puts "Test framework              : #{@test_fw}"
      puts "Optimization dbg            : #{@optimization_dbg}"
      puts "Optimization release        : #{@optimization_release}"
      puts "Language Standard for C     : #{@language_std_c}"
      puts "Language Standard for C++   : #{@language_std_cpp}"
      puts "Software version string     : #{@sw_version}"
      puts "Generate bin file           : #{@generate_bin}"
      puts "Generate hex file           : #{@generate_hex}"
      puts "Generate map file           : #{@generate_map}"
      puts "Strip objects               : #{@stripped}"
    end
1132635
function (done) {

      // Build HTTP server and listen on a port.
      app = connect();
      app = routify(app);

      // Give ourselves a dumbed-down impl. of res.json()
      // and res.send() to make things easier in the tests.
      // (these will not work all the time)
      // Also add req.is() for use in Skipper core (bypasses Express 4 compat. check)
      app.use(function (req, res, next) {

        req.is = function(/*mimeTypeExpr*/) {
          console.warn('Note: req.is() doesn\'t actually work in our routification shim.  (It always returns false.)');
          return false;
        };
        res.send = function (body) {
          if (body !== undefined) {
            res.write(body);
          }
          res.end();
        };
        res.json = function (body){
          body = JSON.stringify(body);
          return res.send(body);
        };
        next();
      });

      app.use(skipper());

      server = app.listen(PORT, done);

      // Expose globals for tests to use
      // (because we're too hog wild for that require shit + c'mon these are tests...)
      global['_'] = _;
      global['assert'] = assert;
      global['request'] = request;
      global['fsx'] = fsx;

      global['server'] = server;
      global['app'] = app;

      global['baseurl'] = 'http://localhost:'+PORT;
      global['domain'] = 'localhost';
      global['port'] = PORT;


      // Create an array of file fixtures.
      fileFixtures = [];

      // Create a tmp directory for our uploads to live in.
      outputDir = new Temporary.Dir();

      // Write nonsense bytes to our file fixtures.
      for (var bytes=10; bytes <= 100000; bytes*=10) {
        GENERATE_NONSENSE_FILE(bytes);
      }
      // Make another set for good measure.
      for (bytes=10; bytes <= 100000; bytes*=10) {
        GENERATE_NONSENSE_FILE(bytes);
      }


      global['fixtures'] = {
        files: fileFixtures,
        dir: outputDir
      };
    }
792794
function (platforms) {
  var deferred = Q.defer();
  var sequence = Q();
  var all = [];
  _(platforms).where({ isAdded : true }).forEach(function (platform) {
    sequence = sequence.then(function () {
      return generateSplashForPlatform(platform);
    });
    all.push(sequence);
  });
  Q.all(all).then(function () {
    deferred.resolve();
  });
  return deferred.promise;
}
793494
public static void dump(Printer printer, String[] args) {
        boolean verbose = false;
        for (String arg : args) {
            if (arg.equals("-v")) {
                verbose = true;
            }
        }

        SQLiteDatabase.dumpAll(printer, verbose);
    }
723203
function(args, done) {
  debug('checking required files with args', args);
  var dir = path.resolve(args['<directory>']);

  var tasks = [
    'README*',
    'LICENSE',
    '.travis.yml',
    '.gitignore'
  ].map(function requireFileExists(pattern) {
    return function(cb) {
      glob(pattern, {
        cwd: dir
      }, function(err, files) {
        debug('resolved %s for `%s`', files, pattern);
        if (err) {
          return cb(err);
        }
        if (files.length === 0) {
          return done(new Error('missing required file matching ' + pattern));
        }
        if (files.length > 1) {
          return done(new Error('more than one file matched ' + pattern));
        }

        fs.exists(files[0], function(exists) {
          if (!exists) {
            return done(new Error('missing required file matching ' + files[0]));
          }
          return cb(null, files[0]);
        });
      });
    };
  });
  async.parallel(tasks, done);
}
1355007
function (application) {
    /*  determine connector filename  */
    var id = os.platform() + "-" + application;
    var cn = connectors[id];
    if (typeof cn === "undefined")
        throw new Error("unsupported platform/application combination: " + id);
    var filename = path.join(__dirname, cn);

    /*  spawn the connector as a child process  */
    this.c = spawn(filename, [], {
        stdio: [ "pipe", "pipe", process.stderr ],
        env: { "CONNECTOR": "FIXME" }
    });

    /*  set the stdin/stdout pipes to UTF-8 encoding mode  */
    this.c.stdin.setEncoding("utf8");
    this.c.stdout.setEncoding("utf8");

    /*  create line-based duplex stream out of stdin/stdout piples  */
    this.io = es.duplex(
        this.c.stdin,
        this.c.stdout.pipe(es.split(/\r?\n/))
    );

    /*  connect to the stream for capturing responses  */
    this.responses = [];
    this.io.pipe(es.through(function onData (data) {
        if (typeof data === "undefined" || data === "")
            return;
        var response = this.responses.shift();
        if (typeof response === "function")
            response(data);
    }.bind(this), function onEnd () {
        /*  currently nothing to do?!  */
    }));
}
22749
function hook_stdout(callback) {
        var old_write;
        var useProcess;
        if(typeof(process)!=="undefined") {
            old_write = process.stdout.write;
            useProcess = true;
            process.stdout.write = (function(write) {
                return function(string, encoding, fd) {
                    write.apply(process.stdout, arguments);
                    callback(string, encoding, fd);
                };
            })(old_write);
        }
        else {
            old_write = console.log.bind(console);
            useProcess = false;
            console.log = (function(write) {
                return function(string) {
                    write.apply(string);
                    callback(string, "utf8");
                };
            })(old_write);
        }
        return function() {
            if(useProcess) {
                process.stdout.write = old_write;
            }
            else {
                console.log = old_write;
            }
        };
    }
622069
function _run(cmd, done) {
  var child = exec(cmd, function (error, stdout, stderr) {
    if(stdout) console.log('O: ' + stdout);
    if(stderr) console.log('E: ' + stderr);
    if (error !== null) {
      console.log('exec error: ' + error);
      console.log('error code: ' + error.code);
      done(error);
    } else {
      done();
    }
    return;
  });
  return child.pid;
}
517106
function dump(opts) {
	if(typeof opts.dump !== "string") {
		throw new Error("no input file");
	}
	
	var bundle = new Bundle(opts.dump);
	
	// Dump a single symbol
	if(opts._.length > 0 || opts.b) {
		var symbol = opts._[0] || opts.b;
		process.stdout.write(bundle.load(symbol, true), (opts.b ? "base64" : "utf8"));
		return;
	}
	
	// Dump the whole bundle
	
	console.log("SYMBOLS:");
	for(var symbol in bundle.symbols()) {
		var sym = bundle.symbol(symbol);
		
		var flag = sym.flag;
		if(flag === "") {
			flag = " ";
		}
		
		console.log(util.format("  [%s] %s", flag, symbol));
	}
	
	console.log("\nPATHS-MAP:");
	for(var path in bundle.map()) {
		console.log(util.format("  %s -> %s", path, bundle.resolve(path)));
	}
	
	console.log("\nAUTORUNS:");
	bundle.autoruns().forEach(function(autorun) {
		console.log(util.format("  %s", autorun));
	});
}
595419
function writeText(wasmModule, format, output, callback) {
  if (format === "linear" || format === "stack") {
    if (!assemblyscript.util.wabt) {
      process.stderr.write("\nwabt.js not found\n");
      return callback(EFAILURE);
    }
    var binary = wasmModule.ascCurrentBinary || (wasmModule.ascCurrentBinary = wasmModule.emitBinary()); // reuse
    output.write(assemblyscript.util.wasmToWast(binary, { readDebugNames: true }), "utf8", end);
  } else
    output.write(wasmModule.emitText(), "utf8", end);

  function end(err) {
    if (err || output === process.stdout) return callback(err);
    output.end(callback);
  }
}
919395
function clean(done) {
	var del = require('del');
	del(cfg.destination).then(function () {
		if (typeof done === 'function') done();
		else process.exit();
	});
}
783516
function bundle (file, options) {
  api.bundle(file, options)
    .then((bundled) => {
      if (options.outfile) {
        console.log("Created %s from %s", options.outfile, file);
      }
      else {
        // Write the bundled API to stdout
        console.log(bundled);
      }
    })
    .catch(errorHandler);
}
184266
function(endpoint,args,done) {

    var qs = util.getPaginationQS(args);

    endpoint +=  '?' + qs;
    util.getEndpoint(endpoint,args,done);
}