-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathindex.js
More file actions
executable file
·36 lines (29 loc) · 834 Bytes
/
Copy pathindex.js
File metadata and controls
executable file
·36 lines (29 loc) · 834 Bytes
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
#!/usr/bin/env node
// Dependencies
import minimist from 'minimist'
import { loadConfig } from './commands/lib/config.js'
// Load config file before importing commands, so env vars (incl. WH_LOG_LEVEL)
// are set before modules initialize.
loadConfig();
const argv = minimist(process.argv.slice(2));
const command = argv['_'][0];
const version = '0.3.3';
switch (command) {
case 'forward': {
const { default: forward } = await import('./commands/forward.js');
forward(argv);
break;
}
case 'exec': {
const { default: exec } = await import('./commands/exec.js');
exec(argv);
break;
}
case 'version':
console.log(version);
break;
default: {
const { default: help } = await import('./commands/help.js');
help(version);
}
}