-
Notifications
You must be signed in to change notification settings - Fork 5
/
cli.js
executable file
·41 lines (38 loc) · 1023 Bytes
/
cli.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
33
34
35
36
37
38
39
40
41
#!/usr/bin/env node
const {files} = require('./utils')
require('yargs')
.scriptName("azimuth-cli")
.commandDir('cmds')
.demandCommand()
.options(getUniversalOptions())
.config('config-file', configFile => files.readJsonObject('', configFile))
.help()
.argv
function getUniversalOptions()
{
return{
'd':{
alias: 'work-dir',
describe: 'The work directory for the current command, mandatory for some commands. If it does not exist, it will be created.',
default: '.',
type: 'string',
},
'eth-provider':{
describe: 'What Ethereum provider to use.',
default: 'mainnet',
choices: ['ganache', 'ropsten', 'mainnet'],
type: 'string'
},
'roller-provider':{
describe: 'What L2 roller provider to use.',
default: 'urbit',
choices: ['local', 'urbit'],
type: 'string'
},
'config-file':{
describe: 'What config file to use.',
default: files.ensureDefaultConfigFilePath(),
type: 'string',
},
}
}