files
   1| 
   2| 
   3| 
   4| 
   5| 
   6| 
   7| 
   8| 
   9| 
  10| 
  11| 
  12| 
  13| 
  14| 
  15| 
  16| 
  17| 
  18| 
  19| 
  20| 
  21| 
  22| 
  23| 
  24| 
  25| 
  26| 
  27| 
  28| 
  29| 
  30| 
  31| 
  32| 
  33| 
  34| 
  35| 

    
#!/usr/bin/env node
import { program } from "commander";
import { start } from "./debug/bench";
import { enableFlag } from "./debug/flags";
import { main } from "./index";

program
  .option('-i, --input <file>', 'lsif dump path', 'dump.lsif')
  .option('-o, --output <file>', 'output folder for generated files', 'out')
  .option('--dist <path>', 'customized absolute path to assets')
  .option('--uri-map <path>', 'customized locations for file tree')
  .option('--bench', 'enable benchmarking logs')
  .option('--check', 'enable integrity checking');

export type CliOptions = {
  input: string;
  output: string;
  dist?: string;
  uriMap?: string;
  bench: boolean;
  check: boolean;
};

const cli = async () => {
  const bench = start("Building sourcetree of your code", true);
  program.parse(process.argv);
  const options: CliOptions = program.opts();
  if (options.bench) enableFlag('bench');
  if (options.check) enableFlag('check');
  await main(options);
  bench.end();
};

cli();