Skip to content
Myr

env

This file

Path

examples/env

23 lines · 443 bytes

Last changed by

Examples: use "require" that works from git repo, and lint. (#1072)John Geebefore adoption57e9d98

History of this file

Take it

1#!/usr/bin/env node23var program = require('../');45let cmdValue;6let envValue;78program9  .version('0.0.1')10  .arguments('<cmd> [env]')11  .action(function(cmd, env) {12    cmdValue = cmd;13    envValue = env;14  });1516program.parse(process.argv);1718if (typeof cmdValue === 'undefined') {19  console.error('no command given!');20  process.exit(1);21}22console.log('command:', cmdValue);23console.log('environment:', envValue || 'no environment given');