@fws/cli
Version:
This CLI is work in progress and it's meant to work together with other Forwardslash boilerplates. Please do not use it if you don't have access to other stuff.
23 lines (19 loc) • 636 B
JavaScript
const config = require('../src/config');
const helpers = require('../src/helpers');
const commander = require('commander');
const store = require('../src/store');
/*
* Init FWS CLI. */
const program = new commander.Command();
program.version(store.getters.getCliVersion());
/*
* Error on unknown commands. */
program.on('command:*', function() {
const errorMsg = `Invalid FWS Command: '${program.args.join(' ')}'!\n Type 'fws -h' for a list of available commands.`;
helpers.consoleLogWarning(errorMsg, 'red', true);
});
/*
* Run CLI configuration. */
config.init(program);
program.parse(process.argv);