Socket
Socket
Sign inDemoInstall

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 usage info when using the protogram module


Version published
Weekly downloads
1.2K
increased by14.02%
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 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

FAQs

Package last updated on 09 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc