Skip to content

Commit

Permalink
feat: ignore unknown flags (#11)
Browse files Browse the repository at this point in the history
* feat: ignore unknown flags

* docs: update readme
  • Loading branch information
privatenumber authored Jun 30, 2022
1 parent 78fff6e commit 9be7f0c
Show file tree
Hide file tree
Showing 5 changed files with 139 additions and 344 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ $ node ./cli -vvv # logs 3

## ⚙️ API

### typeFlag(flagSchema, argv?)
### typeFlag(flagSchema, argv, options)

Returns an object with the shape:
```ts
Expand Down Expand Up @@ -415,3 +415,13 @@ Type: `string[]`
Default: `process.argv.slice(2)`
The argv array to parse.
#### options
Type:
```ts
type Options = {
// Whether not to parse unknown flags (treat as arguments)
ignoreUnknown?: boolean
}
```
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@
},
"devDependencies": {
"@pvtnbr/eslint-config": "^0.26.1",
"@types/node": "^17.0.29",
"@types/node": "^18.0.0",
"eslint": "^8.18.0",
"manten": "^0.2.0",
"pkgroll": "^1.0.5",
"tsd": "^0.20.0",
"pkgroll": "^1.3.1",
"tsd": "^0.21.0",
"tsx": "^3.6.0",
"typescript": "^4.7.4"
},
Expand Down
Loading

0 comments on commit 9be7f0c

Please # to comment.