cli-router
Advanced tools
Comparing version 0.3.6 to 0.3.7
@@ -117,3 +117,9 @@ 'use strict'; | ||
} else if (!R.isNil(route.fn)) { | ||
fn = route.fn; | ||
fn = function () { | ||
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | ||
args[_key2] = arguments[_key2]; | ||
} | ||
return route.fn.apply(params, args); | ||
}; | ||
} | ||
@@ -258,2 +264,2 @@ return fn; | ||
exports.CliRouter = CliRouter; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNsaV9yb3V0ZXIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7O0FBQUEsSUFBSSxDQUFDLEdBQU0sT0FBTyxDQUFDLE9BQU8sQ0FBQyxDQUFDO0FBQzVCLElBQUksSUFBSSxHQUFHLE9BQU8sQ0FBQyxNQUFNLENBQUMsQ0FBQzs7SUFFZCxTQUFTO0FBQ1QsV0FEQSxTQUFTLENBQ1IsZ0JBQWdCLEVBQUU7MEJBRG5CLFNBQVM7O0FBRWxCLFFBQUksQ0FBQyxnQkFBZ0IsR0FBRyxnQkFBZ0IsSUFBSSxJQUFJLENBQUM7O0FBRWpELFFBQUksQ0FBQyxNQUFNLEdBQUcsRUFBRSxDQUFDOztBQUVqQixRQUFJLENBQUMsV0FBVyxHQUFHLHdCQUF3QixDQUFDO0dBQzdDOztlQVBVLFNBQVM7O1dBU2pCLGFBQUMsSUFBSSxFQUFFLE1BQU0sRUFBRSxVQUFVLEVBQUU7QUFDNUIsVUFBSSxDQUFDLENBQUMsS0FBSyxDQUFDLElBQUksQ0FBQyxFQUFFO0FBQ2pCLGNBQU0sSUFBSSxLQUFLLENBQUMsd0JBQXdCLENBQUMsQ0FBQztPQUMzQztBQUNELGdCQUFVLEdBQUcsVUFBVSxJQUFJLElBQUksQ0FBQztBQUNoQyxVQUFJLE9BQU8sR0FBRyxFQUFFLENBQUM7QUFD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KChhY3Rpb24pID0+IHRoaXMuX2NhbWVsQ2FzZShhY3Rpb24pLCBzdHIpO1xuICAgIH1cbiAgICBpZiAoIVIuaXNOaWwoc3RyKSkge1xuICAgICAgc3RyID0gc3RyLnJlcGxhY2UoL1tfLi1dKFxcd3wkKS9nLCBmdW5jdGlvbiAoXywgeCkge1xuICAgICAgICByZXR1cm4geC50b1VwcGVyQ2FzZSgpO1xuICAgICAgfSk7XG4gICAgfVxuICAgIHJldHVybiBzdHI7XG4gIH1cblxuICBydW4oYXJncywgb3B0cywgb2JqKSB7XG4gICAgaWYgKCEob3B0cy5oYXNPd25Qcm9wZXJ0eSgnZGVmYXVsdF9wYXJhbXMnKSAmJiBSLmlzKE9iamVjdCwgb3B0cy5kZWZhdWx0X3BhcmFtcykpKSB7XG4gICAgICBvcHRzID0geyBkZWZhdWx0X3BhcmFtczogb3B0cyB9O1xuICAgIH1cbiAgICB2YXIgW2NhcmdzLCBwYXJhbXMsIG5vcm1hbGl6ZWRfcGFyYW1zXSA9IHRoaXMuY2xlYW5BcmdzKGFyZ3MsIG9wdHMuZGVmYXVsdF9wYXJhbXMpO1xuICAgIHZhciByb3V0ZSA9IHRoaXMuZmluZChhcmdzLCBvcHRzLmRlZmF1bHRfcGFyYW1zKTtcblxuICAgIG9wdHMgPSBSLm1lcmdlKG9wdHMsIHsgYXJncywgcGFyYW1zLCBub3JtYWxpemVkX3BhcmFtcyB9KTtcbiAgICB2YXIgZm4gPSB0aGlzLmdldEZuKHJvdXRlLCBjYXJncywgb3B0cyk7XG5cbiAgICBpZiAoUi5pcyhGdW5jdGlvbiwgZm4pKSB7XG4gICAgICByZXR1cm4gZm4ocGFyYW1zLCAob2JqIHx8IHRoaXMpKTtcbiAgICB9XG4gIH1cbn1cbiJdLCJzb3VyY2VSb290IjoiL2NsaS1yb3V0ZXI6MC4zLjYvc3JjIn0= |
{ | ||
"name": "cli-router", | ||
"version": "0.3.6", | ||
"version": "0.3.7", | ||
"description": "cli-router", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -17,20 +17,82 @@ # cli-router | ||
- `./usage.txt`: | ||
``` | ||
Hello Word | ||
Usage: | ||
usage hello <name> [--help] | ||
usage now [--help] | ||
usage version | ||
usage [--version | -h | --help] | ||
Options: | ||
--help, -h Show this help. | ||
--version Show version. | ||
``` | ||
- `./hello` | ||
```javascript | ||
#!/usr/bin/env node | ||
var path = require('path'); | ||
var Cli = require('cli-router').Cli; | ||
var cli = new Cli({ | ||
// Caminho para o arquivo de usage (seguindo o padrão do docopt. | ||
path: path.join(__dirname, `usage.txt`), | ||
// Diretório onde estão os controladores | ||
controllers_root: path.join(__dirname, "controllers") | ||
}); | ||
var Cli = require('../lib/src').Cli; | ||
var cli = new Cli({ path: path.join(__dirname, 'usage.txt') }); | ||
cli | ||
.route('help', function(p, args) { return p.help || p['--help'] || args.length <= 0 }) | ||
.route('version', function(p) { return p.version || p['--version'] }) | ||
.route('now', null, function() { return (new Date()).toString(); }); | ||
.route('hello'); | ||
var result = cli.run({ | ||
argv: process.argv.slice(2), | ||
version: '2.0' | ||
}, { | ||
// ui: {}, | ||
cwd: process.cwd() | ||
}); | ||
// passa os argumentos para o cli-router executar | ||
var result = cli.run({ argv: process.argv.slice(2) }); | ||
console.log(result); | ||
``` | ||
- `controllers/hello.js` | ||
```javascript | ||
// Used ES6 JS | ||
var CliController = require('cli-router').CliController; | ||
class Hello extends CliController { | ||
} | ||
module.exports = Hello; | ||
``` | ||
- `controllers/help.js` | ||
```javascript | ||
// Used ES6 JS | ||
var chalk = require('chalk'); | ||
var CliControllers = require('cli-router').CliControllers; | ||
class Help extends CliControllers.Help { | ||
index(params, cli) { | ||
var usage = super.index(params, cli); | ||
usage = this.colorizeSections(params, usage); | ||
console.log(usage); | ||
return 0; | ||
} | ||
colorizeSections(params, usage) { | ||
_.map(this.sections, (section) => { | ||
var regex = new RegExp(`^(${section}:)`, 'gmi'); | ||
var match = regex.match(usage); | ||
if (match) { | ||
usage = usage.replace(regex, chalk.blue(`${match[1]}`)); | ||
} | ||
}); | ||
return usage; | ||
} | ||
} | ||
module.exports = Help; | ||
``` | ||
## CONTRIBUTING | ||
@@ -37,0 +99,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
152910
1117
151