Comparing version 12.1.2 to 12.1.3
# Changlog | ||
## [12.1.3](https://github.com/esatterwhite/node-seeli/compare/v12.1.2...v12.1.3) (2021-03-01) | ||
### Bug Fixes | ||
* **help:** allow printing for invalid commands ([1a13e9c](https://github.com/esatterwhite/node-seeli/commit/1a13e9c8d3242d75bc1815269dca04bee24e92f0)) | ||
## [12.1.2](https://github.com/esatterwhite/node-seeli/compare/v12.1.1...v12.1.2) (2021-02-26) | ||
@@ -4,0 +11,0 @@ |
@@ -42,6 +42,28 @@ /* eslint-disable consistent-this */ | ||
const commands = require('./') | ||
const cls = lookup.length | ||
let cls = lookup.length | ||
? commands.resolve(lookup) | ||
: commands.get(cmd) | ||
let output = [] | ||
if (cls === undefined && lookup.length) { | ||
while (cls === undefined && lookup.length) { | ||
// This means the last lookup failed. | ||
// So, pop it off | ||
const bad_command = lookup.pop() | ||
const pre_command = conf.get('name') + ' ' + lookup.join(' ') | ||
const len = pre_command.length + 1 | ||
output = [ | ||
'Invalid command:' | ||
, '' | ||
, `$ ${pre_command} ${this.colorize('red', bad_command)}` | ||
, '-'.repeat(len + 2) + '^'.repeat(bad_command.length) | ||
, '' | ||
, `Below is the usage for ${this.colorize('bold', pre_command)}:` | ||
, '' | ||
] | ||
cls = commands.resolve(lookup) | ||
} | ||
} | ||
const instance = HELP_REGEX.test(cmd) | ||
@@ -51,3 +73,3 @@ ? this | ||
let output = [instance.description] | ||
output.push(instance.description) | ||
@@ -54,0 +76,0 @@ try { |
{ | ||
"name": "seeli", | ||
"version": "12.1.2", | ||
"version": "12.1.3", | ||
"description": "Object oriented, flexible CLI tools", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
102135
1370