Sha256: 4a802a6b28e77c44af2ca359370b4674e19ab36eac8b512785c6867971c11da9

Contents?: true

Size: 1.09 KB

Versions: 105

Compression:

Stored size: 1.09 KB

Contents

/*:nodoc:*
 * class ActionHelp
 *
 * Support action for printing help
 * This class inherided from [[Action]]
 **/
'use strict';

var util = require('util');

var Action = require('../action');

// Constants
var c  = require('../const');

/*:nodoc:*
 * new ActionHelp(options)
 * - options (object): options hash see [[Action.new]]
 *
 **/
var ActionHelp = module.exports = function ActionHelp(options) {
  options = options || {};
  if (options.defaultValue !== null) {
    options.defaultValue = options.defaultValue;
  } else {
    options.defaultValue = c.SUPPRESS;
  }
  options.dest = (options.dest !== null ? options.dest : c.SUPPRESS);
  options.nargs = 0;
  Action.call(this, options);

};
util.inherits(ActionHelp, Action);

/*:nodoc:*
 * ActionHelp#call(parser, namespace, values, optionString)
 * - parser (ArgumentParser): current parser
 * - namespace (Namespace): namespace for output data
 * - values (Array): parsed values
 * - optionString (Array): input option string(not parsed)
 *
 * Print help and exit
 **/
ActionHelp.prototype.call = function (parser) {
  parser.printHelp();
  parser.exit();
};

Version data entries

105 entries across 104 versions & 18 rubygems

Version Path
govuk_publishing_components-16.28.0 node_modules/argparse/lib/action/help.js
govuk_publishing_components-16.27.1 node_modules/argparse/lib/action/help.js
govuk_publishing_components-16.27.0 node_modules/argparse/lib/action/help.js
govuk_publishing_components-16.26.0 node_modules/argparse/lib/action/help.js
govuk_publishing_components-16.25.0 node_modules/argparse/lib/action/help.js
govuk_publishing_components-16.24.0 node_modules/argparse/lib/action/help.js
govuk_publishing_components-16.23.0 node_modules/argparse/lib/action/help.js
govuk_publishing_components-16.22.0 node_modules/argparse/lib/action/help.js
govuk_publishing_components-16.21.0 node_modules/argparse/lib/action/help.js
govuk_publishing_components-16.20.1 node_modules/argparse/lib/action/help.js
govuk_publishing_components-16.20.0 node_modules/argparse/lib/action/help.js
govuk_publishing_components-16.19.0 node_modules/argparse/lib/action/help.js
govuk_publishing_components-16.18.0 node_modules/argparse/lib/action/help.js
govuk_publishing_components-16.17.0 node_modules/argparse/lib/action/help.js
blsk-sevcore-0.0.2 blsk_old/bluesky-doc/bluesky-doc/node_modules/argparse/lib/action/help.js
optimacms-0.4.3 spec/dummy/node_modules/argparse/lib/action/help.js
optimacms-0.4.2 spec/dummy/node_modules/argparse/lib/action/help.js
locomotivecms-4.0.0.alpha1 app/javascript/node_modules/argparse/lib/action/help.js
locomotivecms-3.4.0 app/javascript/node_modules/argparse/lib/action/help.js
cortex-0.1.3 spec/dummy/node_modules/argparse/lib/action/help.js