Comparing version 5.0.11 to 5.0.12
@@ -42,2 +42,4 @@ 'use strict'; | ||
const REVERSE_OPTION_MATCH = /^no\-[a-z]/i; | ||
const REVERSE_OPTION_PREFIX = /^no\-/i; | ||
class Options { | ||
@@ -75,3 +77,8 @@ constructor() { | ||
getOptionNamesByType(type) { | ||
return this.getOptionsByType(type).map(option => option.name); | ||
return this.getOptionsByType(type).map(option => { | ||
if (REVERSE_OPTION_MATCH.test(option.name)) { | ||
return option.name.replace(REVERSE_OPTION_PREFIX, ''); | ||
} | ||
return option.name; | ||
}); | ||
} | ||
@@ -258,3 +265,3 @@ getAliasMap() { | ||
defaultOpts = defaultOpts || true; | ||
this.bin = bin || path.basename(process.argv[1]); | ||
this.bin = bin || process.argv[1] ? path.basename(process.argv[1]) : 'cli'; | ||
this.commands = []; | ||
@@ -261,0 +268,0 @@ this.options = new Options(); |
{ | ||
"name": "cac", | ||
"version": "5.0.11", | ||
"version": "5.0.12", | ||
"description": "Command-line queen.", | ||
@@ -5,0 +5,0 @@ "repository": { |
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
33107
694