1 | #!/usr/bin/env node
|
2 |
|
3 | const argparse = require('argparse');
|
4 | const version = require('./src/version').version;
|
5 | const view = require("./cli/view");
|
6 | const build = require("./cli/build");
|
7 | const develop = require("./cli/develop");
|
8 | const convert = require("./cli/convert");
|
9 |
|
10 | const parser = new argparse.ArgumentParser({
|
11 | version: version,
|
12 | addHelp: true,
|
13 | description: `Auspice version ${version}.`,
|
14 | epilog: `
|
15 | Auspice is an interactive visualisation tool for phylogenomic data.
|
16 | It can be used to display local datasets (see "auspice view -h" for details),
|
17 | or to build a customised version of the software (see "auspice build -h" for details).
|
18 | This is the software which powers the visualisations on nextstrain.org and auspice.us, amoung others.
|
19 | `
|
20 | });
|
21 |
|
22 | const subparsers = parser.addSubparsers({title: 'Auspice commands', dest: "subcommand"});
|
23 | view.addParser(subparsers);
|
24 | build.addParser(subparsers);
|
25 | develop.addParser(subparsers);
|
26 | convert.addParser(subparsers);
|
27 |
|
28 | const args = parser.parseArgs();
|
29 |
|
30 | if (args.verbose) global.AUSPICE_VERBOSE = true;
|
31 |
|
32 | if (args.subcommand === "build") {
|
33 | build.run(args);
|
34 | } else if (args.subcommand === "view") {
|
35 | view.run(args);
|
36 | } else if (args.subcommand === "develop") {
|
37 | develop.run(args);
|
38 | } else if (args.subcommand === "convert") {
|
39 | convert.run(args);
|
40 | }
|
41 |
|
42 |
|