Sha256: 3f9c9c87f0d880101e7957436eb876a2b9352f40d0f9b19b34bf597ba90b6128

Contents?: true

Size: 1.01 KB

Versions: 244

Compression:

Stored size: 1.01 KB

Contents

/*:nodoc:*
 * class ActionCount
 *
 * This counts the number of times a keyword argument occurs.
 * For example, this is useful for increasing verbosity levels
 *
 * This class inherided from [[Action]]
 *
 **/
'use strict';

var util = require('util');

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

/*:nodoc:*
 * new ActionCount(options)
 * - options (object): options hash see [[Action.new]]
 *
 **/
var ActionCount = module.exports = function ActionCount(options) {
  options = options || {};
  options.nargs = 0;

  Action.call(this, options);
};
util.inherits(ActionCount, Action);

/*:nodoc:*
 * ActionCount#call(parser, namespace, values, optionString) -> Void
 * - parser (ArgumentParser): current parser
 * - namespace (Namespace): namespace for output data
 * - values (Array): parsed values
 * - optionString (Array): input option string(not parsed)
 *
 * Call the action. Save result in namespace object
 **/
ActionCount.prototype.call = function (parser, namespace) {
  namespace.set(this.dest, (namespace[this.dest] || 0) + 1);
};

Version data entries

244 entries across 229 versions & 26 rubygems

Version Path
ilog-0.4.1 node_modules/argparse/lib/action/count.js
ilog-0.4.0 node_modules/argparse/lib/action/count.js
ilog-0.3.3 node_modules/argparse/lib/action/count.js
learn_create-0.0.22 lib/templates/javascript_lab_template/node_modules/argparse/lib/action/count.js
jester-data-8.0.0 node_modules/argparse/lib/action/count.js
ezii-os-5.2.1 node_modules/argparse/lib/action/count.js
ezii-os-2.0.1 node_modules/argparse/lib/action/count.js
ezii-os-1.1.0 node_modules/argparse/lib/action/count.js
ezii-os-1.0.0 node_modules/argparse/lib/action/count.js
ezii-os-0.0.0.1.0 node_modules/argparse/lib/action/count.js
ezii-os-0.0.0.0.1 node_modules/argparse/lib/action/count.js
govuk_publishing_components-18.0.0 node_modules/argparse/lib/action/count.js
govuk_publishing_components-17.21.0 node_modules/argparse/lib/action/count.js
govuk_publishing_components-17.20.0 node_modules/argparse/lib/action/count.js
govuk_publishing_components-17.19.1 node_modules/argparse/lib/action/count.js
govuk_publishing_components-17.19.0 node_modules/argparse/lib/action/count.js
govuk_publishing_components-17.18.0 node_modules/argparse/lib/action/count.js
govuk_publishing_components-17.17.0 node_modules/argparse/lib/action/count.js
govuk_publishing_components-17.16.0 node_modules/argparse/lib/action/count.js
govuk_publishing_components-17.15.0 node_modules/argparse/lib/action/count.js