aboutsummaryrefslogtreecommitdiffstats
path: root/node_modules/nopt/bin
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/nopt/bin')
-rwxr-xr-xnode_modules/nopt/bin/nopt.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/node_modules/nopt/bin/nopt.js b/node_modules/nopt/bin/nopt.js
new file mode 100755
index 0000000..6ed2082
--- /dev/null
+++ b/node_modules/nopt/bin/nopt.js
@@ -0,0 +1,29 @@
+#!/usr/bin/env node
+const nopt = require('../lib/nopt')
+const path = require('path')
+console.log('parsed', nopt({
+ num: Number,
+ bool: Boolean,
+ help: Boolean,
+ list: Array,
+ 'num-list': [Number, Array],
+ 'str-list': [String, Array],
+ 'bool-list': [Boolean, Array],
+ str: String,
+ clear: Boolean,
+ config: Boolean,
+ length: Number,
+ file: path,
+}, {
+ s: ['--str', 'astring'],
+ b: ['--bool'],
+ nb: ['--no-bool'],
+ tft: ['--bool-list', '--no-bool-list', '--bool-list', 'true'],
+ '?': ['--help'],
+ h: ['--help'],
+ H: ['--help'],
+ n: ['--num', '125'],
+ c: ['--config'],
+ l: ['--length'],
+ f: ['--file'],
+}, process.argv, 2))