0.0.10 • Published 5 years ago

vamtiger-commandline-help v0.0.10

Weekly downloads
24
License
MIT
Repository
github
Last release
5 years ago

VAMTIGER Commandline Help

Get help text.

Installation

VAMTIGER Commandline Help can be installed using npm or yarn:

npm i vamtiger-commandline-help

or

yarn add vamtiger-commandline-help

Once installed, VAMTIGER Commandline Help can be imported.

import getHelp from 'vamtiger-commandline-help';

or

const getHelp = require('vamtiger-commandline-help').default;

Help text can then be referenced as a string table.

const args = {
    argument: 'Argument',
    anotherArgument: 'Another'
};
const short = {
    argument: 'a',
    anotherArgument: 'A'
}
const description = {
    argument: 'Argument description',
    anotherArgument: 'Another argument description'
};
/*
Args can be named as desired.
They just need to have the same key name mappings.

In this instances the column names will be
Args | Short | Description
*/
const help = getHelp({
    args,
    short,
    description
});

console.log(help);
/*
===================================================
| Args | Short | Description                  |
===================================================
| Argument | a     | Argument description         |
---------------------------------------------------
| Another  | A     | Another argument description |
---------------------------------------------------
*/