šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

protogram-help

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

protogram-help

Auto-generate program usage info when using the protogram module

1.0.2
latest
Source
npm
Version published
Weekly downloads
1.1K
1.39%
Maintainers
1
Weekly downloads
Ā 
Created
Source

protogram-help

Build Status

A simple to use, help module to auto generate usage info when using the protogram module for node.js.

Installation

npm install --save protogram-help

Basic Usage

Include with Protogram

var program = require('protogram').create();
var help = require('protogram-help');

Configure Your Help (if you want)

help.set({
    version: '0.0.3',
    name: 'Protogram Help Example',
    handleError: true
});

Add as an Option Flag

program
    .command('*', { includeRoot: true })
    .option('--help', help);

Done.

API

help.set(options)

Sets certain options that will be used to handle the display of usage information.

  • options Object:
    • version String: Your program's version number.
    • name String: The name of your program.
    • handleError Boolean: Output usage information for your program if there is an argument error.
help.set({
    version: '0.0.3',
    name: 'Protogram Help Example',
    handleError: true
});

Or use it directly when setting your --help option:

program
    .command('*', { includeRoot: true })
    .option('--help', help.set({
        version: '0.0.3',
        name: 'Protogram Help Example',
        handleError: true
    }));

help.version

Alternative to help.set({version: xxx })

help.version = '0.0.3';

help.name

Alternative to help.set({name: xxx })

help.name = 'Protogram Help Example';

help.handleError

Alternative to help.set({handleError: xxx })

help.handleError = true;

License

The MIT License (MIT) Copyright (c) 2014 Arjun Mehta

Keywords

commander

FAQs

Package last updated on 10 Jan 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts