fix CLI management

This commit is contained in:
lesion
2022-05-05 16:01:39 +02:00
parent 282b638928
commit 6757ae2dc6
3 changed files with 17 additions and 16 deletions

View File

@@ -22,16 +22,18 @@ require('yargs')
.option('config', {
alias: 'c',
describe: 'Configuration file',
default: path.resolve(process.env.cwd, 'config.json')
})
.coerce('config', config_path => {
const absolute_config_path = path.resolve(process.env.cwd, config_path)
process.env.config_path = absolute_config_path
return absolute_config_path
})
.command(['accounts'], 'Manage accounts', accountsCLI)
default: path.resolve(process.env.cwd, 'config.json'),
coerce: config_path => {
const absolute_config_path = path.resolve(process.env.cwd, config_path)
process.env.config_path = absolute_config_path
return absolute_config_path
}})
.command(['start', 'run', '$0'], 'Start gancio', {}, start)
.command(['accounts'], 'Manage accounts', accountsCLI)
.help('h')
.alias('h', 'help')
.epilog('Made with ❤ by underscore hacklab - https://gancio.org')
.recommendCommands()
.strict()
.demandCommand(1, '')
.argv