@wdfang/getcli

1.0.0 • Public • Published

A command line parser for those who don't like any learning curves.

Installation

$ npm install cli

Usage

Example:

const getcli = require('getcli');

const cli = getcli([
  ['-D', '--delete', 'filename'],
  ['-v', '--verbose', true],
  ['-b', '--brief', 'verbose', false]
]);

if (cli['--delete']) {
  // delete cli.filename
}

Using default values:

const result = getcli([
  ['-u', '--user']
], { user: 'root' });

When running the above with no arguments, result will have the following values:

{ user: 'root', argv: [] }

Readme

Keywords

none

Package Sidebar

Install

npm i @wdfang/getcli

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

5.12 kB

Total Files

5

Last publish

Collaborators

  • wdfang