forked from TheOriginalAndrobot/midi2mqtt
-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.js
32 lines (31 loc) · 1.03 KB
/
config.js
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
var pkg = require('./package.json');
var config = require('yargs')
.usage(pkg.name + ' ' + pkg.version + '\n' + pkg.description + '\n\nUsage: $0 [options]')
.describe('v', 'possible values: "error", "warn", "info", "debug"')
.describe('t', 'prefix for connected topic')
.describe('u', 'mqtt broker url. See https://github.com/mqttjs/MQTT.js#connect-using-a-url')
.describe('i', 'Input MIDI port/device name')
.describe('h', 'show help')
.describe('o', 'Output MIDI port/device name')
.describe('s', 'Subscribe midiin or midiout')
.alias({
'h': 'help',
'v': 'verbosity',
't': 'topic',
'u': 'url',
'i': 'input-midi-port',
'o': 'output-midi-port',
's': 'subscribe'
})
.default({
'v': 'info',
't': 'midi',
'u': 'mqtt://127.0.0.1',
'i': 'loopMIDI Port 0',
'o': 'loopMIDI Port 1',
's': 'midiin'
})
.version(pkg.name + ' ' + pkg.version + '\n', 'version')
.help('help')
.argv;
module.exports = config;