-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcli.js
More file actions
40 lines (36 loc) · 803 Bytes
/
cli.js
File metadata and controls
40 lines (36 loc) · 803 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
37
38
39
40
#!/usr/bin/env node
'use strict';
const meow = require('meow');
const startProxy = require('.').default;
const cli = meow(`
Usage:
$ qsys-qrc-proxy <core-ip> [options]
Options:
--remote-port, -r QRC port on core (defaults to 1710)
--ws-port, -w Socket to proxy via websocket
--tcp-port, -t Socket to proxy with raw TCP
--log, -l Log communications to stdout
Note: Must choose ws-port or tcp-port or both
`, {
flags: {
remotePort: {
alias: 'r',
type: 'number',
default: 1710
},
wsPort: {
alias: 'w',
type: 'number',
isRequired: flags => !flags.tcpPort
},
tcpPort: {
alias: 't',
type: 'number',
isRequired: flags => !flags.wsPort
},
log: {
type: 'boolean'
}
}
});
startProxy(cli.input[0], cli.flags);