optparse-js
optparse-js copied to clipboard
Added ability to add callback inside the switch definition
Usage:
switches = [
['-h', '--help', 'Show Help']
['-i', '--interval [INTERVAL]', 'Ping Interval', (key, val)->
console.log "Interval is" + val
]
['-s', '--packetsize NUMBER', 'Packetsize', (key, val)->
console.log "Packet Size is " + val
]
]
This removes some duplicate code.