UNPKG

gogs-cli

Version:

Commandline interface for your Gogs needs

25 lines (23 loc) 691 B
'use strict'; const config = require('../../lib/config'); const {mkHandler} = require('../../lib/handler'); module.exports = { command: 'get <option>', desc : 'get a configuration option.', builder: function(yargs) { return yargs .completion('option', function(current) { return config .getAvailableOptions() .filter(x => x.indexOf(current !== -1)); }) .positional('option', { describe: 'the option to retrieve the value for', type : 'string', choices : config.getAvailableOptions() }); }, handler: mkHandler((argv) => { return `"${argv.option}" = ${config.getOption(argv.option)}`; }) };