Skip to content
Myr

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 file

Take 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 back
1#!/usr/bin/env node
2

Merge branch 'develop' into release/5.xJohn Geebefore adoption491b2e4

lines 3–4why, one step back
3// const program = require('commander'); // (normal include)
4const program = require('../'); // include commander in git clone of commander repo

Fix typing of help functionYevheniibefore adoption689c0ea

line 5why, one step back
5

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

lines 6–8why, one step back
6let cmdValue;
7let envValue;8

Fix typing of help functionYevheniibefore adoption689c0ea

lines 9–11why, one step back
9program
10 .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 back
12 .action(function(cmd, env) {
13 cmdValue = cmd;14 envValue = env;

Fix typing of help functionYevheniibefore adoption689c0ea

lines 15–19why, one step back
15 });
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 back
20 console.error('no command given!');
21 process.exit(1);

Fix typing of help functionYevheniibefore adoption689c0ea

lines 22–23why, one step back
22}
23console.log('command:', cmdValue);

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

line 24why, one step back
24console.log('environment:', envValue || 'no environment given');