BVB Source Codes

reactide Show version.js Source code

Return Download reactide: download version.js Source code - Download reactide Source code - Type:.js
  1. /*:nodoc:*
  2.  * class ActionVersion
  3.  *
  4.  * Support action for printing program version
  5.  * This class inherited from [[Action]]
  6.  **/
  7. 'use strict';
  8.  
  9. var util = require('util');
  10.  
  11. var Action = require('../action');
  12.  
  13. //
  14. // Constants
  15. //
  16. var c = require('../const');
  17.  
  18. /*:nodoc:*
  19.  * new ActionVersion(options)
  20.  * - options (object): options hash see [[Action.new]]
  21.  *
  22.  **/
  23. var ActionVersion = module.exports = function ActionVersion(options) {
  24.   options = options || {};
  25.   options.defaultValue = (options.defaultValue ? options.defaultValue : c.SUPPRESS);
  26.   options.dest = (options.dest || c.SUPPRESS);
  27.   options.nargs = 0;
  28.   this.version = options.version;
  29.   Action.call(this, options);
  30. };
  31. util.inherits(ActionVersion, Action);
  32.  
  33. /*:nodoc:*
  34.  * ActionVersion#call(parser, namespace, values, optionString) -> Void
  35.  * - parser (ArgumentParser): current parser
  36.  * - namespace (Namespace): namespace for output data
  37.  * - values (Array): parsed values
  38.  * - optionString (Array): input option string(not parsed)
  39.  *
  40.  * Print version and exit
  41.  **/
  42. ActionVersion.prototype.call = function (parser) {
  43.   var version = this.version || parser.version;
  44.   var formatter = parser._getFormatter();
  45.   formatter.addText(version);
  46.   parser.exit(0, formatter.formatHelp());
  47. };
  48.  
downloadversion.js Source code - Download reactide Source code
Related Source Codes/Software:
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
postal - 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top