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
The walk stopped after 200 commits: lines older than 689c0ea point at it.
Fix typing of help functionYevheniibefore adoption689c0ea
lines 1–2why, one step back1#!/usr/bin/env node2Merge branch 'develop' into release/5.xJohn Geebefore adoption491b2e4
lines 3–4why, one step back3// const program = require('commander'); // (normal include)4const program = require('../'); // include commander in git clone of commander repoFix typing of help functionYevheniibefore adoption689c0ea
line 5why, one step back5Examples: use "require" that works from git repo, and lint. (#1072)John Geebefore adoption57e9d98
lines 6–8why, one step back6let cmdValue;7let envValue;8Fix typing of help functionYevheniibefore adoption689c0ea
lines 9–11why, one step back9program10 .version('0.0.1')11 .arguments('<cmd> [env]')Examples: use "require" that works from git repo, and lint. (#1072)John Geebefore adoption57e9d98
lines 12–14why, one step back12 .action(function(cmd, env) {13 cmdValue = cmd;14 envValue = env;Fix typing of help functionYevheniibefore adoption689c0ea
lines 15–19why, one step back15 });1617program.parse(process.argv);1819if (typeof cmdValue === 'undefined') {Examples: use "require" that works from git repo, and lint. (#1072)John Geebefore adoption57e9d98
lines 20–21why, one step back20 console.error('no command given!');21 process.exit(1);Fix typing of help functionYevheniibefore adoption689c0ea
lines 22–23why, one step back22}23console.log('command:', cmdValue);Examples: use "require" that works from git repo, and lint. (#1072)John Geebefore adoption57e9d98
line 24why, one step back24console.log('environment:', envValue || 'no environment given');