Comparing version 1.1.1 to 1.1.2
@@ -9,3 +9,3 @@ "use strict"; | ||
const find = (argv, long, short, bool, number) => { | ||
const re = new RegExp(`-(${short}|-${long})`); | ||
const re = new RegExp(`^-(${short}|-${long})`); | ||
const found = argv.find(a => re.test(a)); | ||
@@ -12,0 +12,0 @@ if (!found) return; |
## 15 June 2018 | ||
### 1.1.2 | ||
- [fix] fix a bug when arguments have `-` in them. | ||
## 15 June 2018 | ||
### 1.1.1 | ||
@@ -4,0 +10,0 @@ |
{ | ||
"name": "argufy", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Parse command line arguments to Node.js CLI programs.", | ||
@@ -5,0 +5,0 @@ "main": "build", |
const find = (argv, long, short, bool, number) => { | ||
const re = new RegExp(`-(${short}|-${long})`) | ||
const re = new RegExp(`^-(${short}|-${long})`) | ||
const found = argv.find(a => re.test(a)) | ||
@@ -4,0 +4,0 @@ if (!found) return |
@@ -72,4 +72,11 @@ import { equal, deepEqual } from 'zoroaster/assert' | ||
}, | ||
'extracts arguments which start with - only'() { | ||
const args = ['.nvm/versions/node/v8.10.0/bin/node', 'script', 'hello-world'] | ||
const res = argufy({ | ||
wait: { short: 'w', boolean: true }, | ||
}, args) | ||
deepEqual(res, {}) | ||
}, | ||
} | ||
export default T |
Sorry, the diff of this file is not supported yet
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
22409
382