// TODO 提示信息国际化方案
// TODO 从组件中读取并进行配置
// TODO 配置读取功能
// TODO 组件读取功能
// TODO 全局模式别去找 npm。有可能安装在其他地方。。。@nowaGUI
// https://www.npmjs.com/package/source-map-support
var yargs = require('yargs')
.usage('$0 command')
.command('hello', 'hello command')
.command('world', 'world command')
.demandCommand(1, 'must provide a valid command'),
argv = yargs.argv,
command = argv._[0];
if (command === 'hello') {
yargs.reset()
.usage('Usage: $0 hello')
.help('h')
.example('$0 hello', 'print the hello message!')
.argv;
console.log('hello!');
} else if (command === 'world') {
yargs.reset()
.usage('$0 world')
.help('h')
.example('$0 world', 'print the world message!')
.argv;
console.log('world!');
} else {
yargs.showHelp();
}