react / wstein / node_modules / jest-cli / node_modules / istanbul / node_modules / js-yaml / node_modules / argparse / lib / action / store.js
80728 views/*:nodoc:*1* class ActionStore2*3* This action just stores the argument’s value. This is the default action.4*5* This class inherited from [[Action]]6*7**/8'use strict';910var util = require('util');1112var Action = require('../action');1314// Constants15var $$ = require('../const');161718/*:nodoc:*19* new ActionStore(options)20* - options (object): options hash see [[Action.new]]21*22**/23var ActionStore = module.exports = function ActionStore(options) {24options = options || {};25if (this.nargs <= 0) {26throw new Error('nargs for store actions must be > 0; if you ' +27'have nothing to store, actions such as store ' +28'true or store const may be more appropriate');2930}31if (this.constant !== undefined && this.nargs !== $$.OPTIONAL) {32throw new Error('nargs must be OPTIONAL to supply const');33}34Action.call(this, options);35};36util.inherits(ActionStore, Action);3738/*:nodoc:*39* ActionStore#call(parser, namespace, values, optionString) -> Void40* - parser (ArgumentParser): current parser41* - namespace (Namespace): namespace for output data42* - values (Array): parsed values43* - optionString (Array): input option string(not parsed)44*45* Call the action. Save result in namespace object46**/47ActionStore.prototype.call = function (parser, namespace, values) {48namespace.set(this.dest, values);49};505152