2 var nopt = require("../lib/nopt")
3 , path = require("path")
4 , types = { num: Number
8 , "num-list": [Number, Array]
9 , "str-list": [String, Array]
10 , "bool-list": [Boolean, Array]
17 , shorthands = { s: [ "--str", "astring" ]
20 , tft: [ "--bool-list", "--no-bool-list", "--bool-list", "true" ]
24 , n: [ "--num", "125" ]
29 , parsed = nopt( types
34 console.log("parsed", parsed)
38 console.log("nopt cli tester")
41 console.log(Object.keys(types).map(function M (t) {
43 if (Array.isArray(type)) {
44 return [t, type.map(function (type) { return type.name })]
46 return [t, type && type.name]
47 }).reduce(function (s, i) {
52 console.log("shorthands")
53 console.log(shorthands)