Skip to content
Myr

env

This file

Path

examples/env

20 lines · 419 bytes

Last changed by

Merge pull request #392 from rrthomas/document-argumentsRandall Koutnikbefore adoptionc6ddd55

History of this file

Take it

1#!/usr/bin/env node23var program = require('../');45program6  .version('0.0.1')7  .arguments('<cmd> [env]')8  .action(function (cmd, env) {9     cmdValue = cmd;10     envValue = env;11  });1213program.parse(process.argv);1415if (typeof cmdValue === 'undefined') {16   console.error('no command given!');17   process.exit(1);18}19console.log('command:', cmdValue);20console.log('environment:', envValue || "no environment given");