mirror of
https://github.com/flynx/argv.js.git
synced 2025-10-29 18:50:09 +00:00
20 lines
392 B
JavaScript
20 lines
392 B
JavaScript
|
|
#!/usr/bin/env node
|
||
|
|
|
||
|
|
// compatible with both node's and RequireJS' require(..)
|
||
|
|
var argv = require('../argv')
|
||
|
|
|
||
|
|
var 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 :
|