env
This file
Path
examples/env
24 lines · 558 bytes
Last changed by
Merge branch 'develop' into release/5.xJohn Geebefore adoption491b2e4
History of this fileTake it
1#!/usr/bin/env node23// const program = require('commander'); // (normal include)4const program = require('../'); // include commander in git clone of commander repo56let cmdValue;7let envValue;89program10 .version('0.0.1')11 .arguments('<cmd> [env]')12 .action(function(cmd, env) {13 cmdValue = cmd;14 envValue = env;15 });1617program.parse(process.argv);1819if (typeof cmdValue === 'undefined') {20 console.error('no command given!');21 process.exit(1);22}23console.log('command:', cmdValue);24console.log('environment:', envValue || 'no environment given');