mirror of
https://github.com/flynx/argv.js.git
synced 2025-10-28 10:20:09 +00:00
22 lines
420 B
JavaScript
22 lines
420 B
JavaScript
#!/usr/bin/env node
|
|
|
|
// compatible with both node's and RequireJS' require(..)
|
|
var argv = require('../argv')
|
|
|
|
var parser =
|
|
exports.parser =
|
|
argv.Parser({
|
|
// option definitions...
|
|
// ...
|
|
})
|
|
.then(function(){
|
|
// things to do after the options are handled...
|
|
// ...
|
|
})
|
|
|
|
// run the parser...
|
|
__filename == (require.main || {}).filename
|
|
&& parser(process.argv)
|
|
|
|
// vim:set ts=4 sw=4 spell :
|