Comparing version 6.1.0 to 6.2.0
@@ -9,2 +9,3 @@ 'use strict' | ||
const chalk = require('chalk') | ||
const abbrev = require('abbrev') | ||
const repeat = require('repeat-string') | ||
@@ -48,2 +49,3 @@ const output = require('./output.js') | ||
let action | ||
let abbrevs = abbrev(Object.keys(this.commands)) | ||
@@ -53,7 +55,7 @@ try { | ||
if (context_first && context_first !== 'help') { | ||
if (!this.commands[context_first]) { | ||
if (!abbrevs[context_first] || !this.commands[abbrevs[context_first]]) { | ||
throw new Error(context_first + ' not found') | ||
} | ||
command = this.commands[context_first] | ||
command = this.commands[abbrevs[context_first]] | ||
} | ||
@@ -60,0 +62,0 @@ |
{ | ||
"name": "sergeant", | ||
"version": "6.1.0", | ||
"version": "6.2.0", | ||
"description": "", | ||
@@ -26,2 +26,3 @@ "main": "code/main.js", | ||
"dependencies": { | ||
"abbrev": "^1.0.7", | ||
"ap": "^0.2.0", | ||
@@ -28,0 +29,0 @@ "async-done": "^1.0.0", |
23736
690
9
+ Addedabbrev@^1.0.7
+ Addedabbrev@1.1.1(transitive)