argv.js/examples/bare.js
Alex A. Naanou dd74fb1444 reworked error handling...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2020-08-01 19:25:31 +03:00

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 :