global.version = "0.1"; const yargs = require('yargs/yargs')() .scriptName(process.argv0) .usage('$0 [] [ ...]') .version(false) .options({ 'version': { alias: 'v', type: 'boolean', description: 'Shows version number' } }) .help(); yargs.parse(process.argv, function yargsCallback(err, args, output) { if (output) { output = output.replace(/\[\w+\]/g, ''); console.log(output); return; } if (args.version) { console.log("unish " + version); } else { require('./core/shell'); } });