forked from qooxdoo/qooxdoo-compiler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
qx
executable file
·45 lines (38 loc) · 999 Bytes
/
qx
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
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env node
const path = require("path");
require("./lib");
// sanatise process list parameter
let args = [path.relative(process.cwd(), process.argv[1])]
for (let i=2; i<process.argv.length; i++) {
let arg = process.argv[i]
if (arg === '--token' || arg === '-t') {
args.push.apply(args, [arg, '*****'])
i++
}
else if (arg.startsWith('--token=')) {
args.push('--token=*****')
}
else if (arg.startsWith('-t')) {
args.push('-t*****')
}
else {
args.push(arg)
}
}
process.title = args.join(" ")
// main config
var title = "qooxdoo command line interface";
title = "\n" + title + "\n" + "=".repeat(title.length) + "\n";
title += `Versions: qooxdoo-compiler v${qx.tool.compiler.Version.VERSION}\n\n`;
title +=
`Typical usage:
qx <commands> [options]
Type qx <command> --help for options and subcommands.`
require('yargs')
.locale("en")
.commandDir('tool/cli/commands')
.usage(title)
.demandCommand()
.strict()
.showHelpOnFail()
.argv;