|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
-
- 'use strict';
-
- var util = require('util');
-
- var ActionContainer = require('../action_container');
-
-
-
- var ArgumentGroup = module.exports = function ArgumentGroup(container, options) {
-
- options = options || {};
-
-
- options.conflictHandler = (options.conflictHandler || container.conflictHandler);
- options.prefixChars = (options.prefixChars || container.prefixChars);
- options.argumentDefault = (options.argumentDefault || container.argumentDefault);
-
- ActionContainer.call(this, options);
-
-
- this.title = options.title;
- this._groupActions = [];
-
-
- this._container = container;
- this._registries = container._registries;
- this._actions = container._actions;
- this._optionStringActions = container._optionStringActions;
- this._defaults = container._defaults;
- this._hasNegativeNumberOptionals = container._hasNegativeNumberOptionals;
- this._mutuallyExclusiveGroups = container._mutuallyExclusiveGroups;
- };
- util.inherits(ArgumentGroup, ActionContainer);
-
-
- ArgumentGroup.prototype._addAction = function (action) {
-
- action = ActionContainer.prototype._addAction.call(this, action);
- this._groupActions.push(action);
- return action;
- };
-
-
- ArgumentGroup.prototype._removeAction = function (action) {
-
- ActionContainer.prototype._removeAction.call(this, action);
- var actionIndex = this._groupActions.indexOf(action);
- if (actionIndex >= 0) {
- this._groupActions.splice(actionIndex, 1);
- }
- };
-
|