Skip to content

Commit 00d9c7d

Browse files
committed
1 parent 3404dca commit 00d9c7d

File tree

14 files changed

+952
-10
lines changed

14 files changed

+952
-10
lines changed

node_modules/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,12 @@
157157
!/node-gyp/node_modules/lru-cache
158158
!/node-gyp/node_modules/make-fetch-happen
159159
!/node-gyp/node_modules/minimatch
160+
!/node-gyp/node_modules/nopt
160161
!/node-gyp/node_modules/path-scurry
161162
!/nopt
163+
!/nopt/node_modules/
164+
/nopt/node_modules/*
165+
!/nopt/node_modules/abbrev
162166
!/npm-audit-report
163167
!/npm-bundled
164168
!/npm-install-checks
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
The ISC License
2+
3+
Copyright (c) Isaac Z. Schlueter and Contributors
4+
5+
Permission to use, copy, modify, and/or distribute this software for any
6+
purpose with or without fee is hereby granted, provided that the above
7+
copyright notice and this permission notice appear in all copies.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
15+
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env node
2+
const nopt = require('../lib/nopt')
3+
const path = require('path')
4+
console.log('parsed', nopt({
5+
num: Number,
6+
bool: Boolean,
7+
help: Boolean,
8+
list: Array,
9+
'num-list': [Number, Array],
10+
'str-list': [String, Array],
11+
'bool-list': [Boolean, Array],
12+
str: String,
13+
clear: Boolean,
14+
config: Boolean,
15+
length: Number,
16+
file: path,
17+
}, {
18+
s: ['--str', 'astring'],
19+
b: ['--bool'],
20+
nb: ['--no-bool'],
21+
tft: ['--bool-list', '--no-bool-list', '--bool-list', 'true'],
22+
'?': ['--help'],
23+
h: ['--help'],
24+
H: ['--help'],
25+
n: ['--num', '125'],
26+
c: ['--config'],
27+
l: ['--length'],
28+
f: ['--file'],
29+
}, process.argv, 2))
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/* istanbul ignore next */
2+
module.exports = process.env.DEBUG_NOPT || process.env.NOPT_DEBUG
3+
// eslint-disable-next-line no-console
4+
? (...a) => console.error(...a)
5+
: () => {}

0 commit comments

Comments
 (0)