Sha256: 1643ef3e19b74c00d582b40614027e49ff1785d5305c399c11d071730b25da44

Contents?: true

Size: 1.29 KB

Versions: 139

Compression:

Stored size: 1.29 KB

Contents

/*:nodoc:*
 * class ActionStoreConstant
 *
 * This action stores the value specified by the const keyword argument.
 * (Note that the const keyword argument defaults to the rather unhelpful null.)
 * The 'store_const' action is most commonly used with optional
 * arguments that specify some sort of flag.
 *
 * This class inherited from [[Action]]
 **/
'use strict';

var util = require('util');

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

/*:nodoc:*
 * new ActionStoreConstant(options)
 * - options (object): options hash see [[Action.new]]
 *
 **/
var ActionStoreConstant = module.exports = function ActionStoreConstant(options) {
  options = options || {};
  options.nargs = 0;
  if (options.constant === undefined) {
    throw new Error('constant option is required for storeAction');
  }
  Action.call(this, options);
};
util.inherits(ActionStoreConstant, Action);

/*:nodoc:*
 * ActionStoreConstant#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
 **/
ActionStoreConstant.prototype.call = function (parser, namespace) {
  namespace.set(this.dest, this.constant);
};

Version data entries

139 entries across 125 versions & 8 rubygems

Version Path
trusty-festivity-extension-2.3.0 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js
opal-0.9.0.beta2 stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js
opal-0.9.0.beta1 stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js
opal-0.8.1 stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js
eslint_node_modules-1.6.0.1 vendor/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js
eslint_node_modules-1.6.0 vendor/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js
opal-0.8.1.rc1 stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js
opal-wedge-0.9.0.dev stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js
opal-0.8.0 stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js
opal-0.8.0.rc3 stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js
opal-0.8.0.rc2 stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js
opal-0.8.0.rc1 stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js
opal-0.8.0.beta1 stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js
opal-0.7.2 stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js
entangled-0.0.16 spec/dummy/public/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js
entangled-0.0.16 spec/dummy/public/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js
entangled-0.0.16 spec/dummy/public/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js
entangled-0.0.15 spec/dummy/public/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js
entangled-0.0.15 spec/dummy/public/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js
entangled-0.0.15 spec/dummy/public/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js