Sha256: 3ed24a4d6d56e50d972e82b866ade25192e004d08d55cb4d5a17bf3a7c239b1a

Contents?: true

Size: 1.32 KB

Versions: 105

Compression:

Stored size: 1.32 KB

Contents

/*:nodoc:*
 * class ActionStore
 *
 * This action just stores the argument’s value. This is the default action.
 *
 * This class inherited from [[Action]]
 *
 **/
'use strict';

var util = require('util');

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

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


/*:nodoc:*
 * new ActionStore(options)
 * - options (object): options hash see [[Action.new]]
 *
 **/
var ActionStore = module.exports = function ActionStore(options) {
  options = options || {};
  if (this.nargs <= 0) {
    throw new Error('nargs for store actions must be > 0; if you ' +
        'have nothing to store, actions such as store ' +
        'true or store const may be more appropriate');

  }
  if (typeof this.constant !== 'undefined' && this.nargs !== c.OPTIONAL) {
    throw new Error('nargs must be OPTIONAL to supply const');
  }
  Action.call(this, options);
};
util.inherits(ActionStore, Action);

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

Version data entries

105 entries across 104 versions & 18 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/argparse/lib/action/store.js
disco_app-0.18.0 test/dummy/node_modules/argparse/lib/action/store.js
disco_app-0.18.2 test/dummy/node_modules/argparse/lib/action/store.js
appmap-0.72.2 ./node_modules/argparse/lib/action/store.js
appmap-0.72.1 ./node_modules/argparse/lib/action/store.js
appmap-0.72.0 ./node_modules/argparse/lib/action/store.js
appmap-0.71.0 ./node_modules/argparse/lib/action/store.js
disco_app-0.16.1 test/dummy/node_modules/argparse/lib/action/store.js
appmap-0.70.2 ./node_modules/argparse/lib/action/store.js
appmap-0.70.1 ./node_modules/argparse/lib/action/store.js
appmap-0.70.0 ./node_modules/argparse/lib/action/store.js
appmap-0.69.0 ./node_modules/argparse/lib/action/store.js
appmap-0.68.2 ./node_modules/argparse/lib/action/store.js
appmap-0.68.1 ./node_modules/argparse/lib/action/store.js
disco_app-0.15.2 test/dummy/node_modules/argparse/lib/action/store.js
appmap-0.68.0 ./node_modules/argparse/lib/action/store.js
appmap-0.67.1 ./node_modules/argparse/lib/action/store.js
appmap-0.67.0 ./node_modules/argparse/lib/action/store.js
disco_app-0.18.4 test/dummy/node_modules/argparse/lib/action/store.js
disco_app-0.18.1 test/dummy/node_modules/argparse/lib/action/store.js