Skip to content

Commit

Permalink
Initialize _version, _versionOptionName in constructor
Browse files Browse the repository at this point in the history
The _version and _versionOptionName properties are initialized to
undefined in the constructor. The reasoning is
- to make them visible when the Command instance is logged into the
console before .version() is called, and not only appear after suddenly
- to not break anything if the proxy use for consistent option value
handling in the legacy setOptionValueWithSource mode suggested in tj#1919
(and previously in tj#1921) is adopted
  • Loading branch information
aweebit committed Aug 3, 2023
1 parent e8bea4a commit b488e6e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ class Command extends EventEmitter {
this._helpCommandnameAndArgs = 'help [command]';
this._helpCommandDescription = 'display help for command';
this._helpConfiguration = {};

this._version = undefined;
this._versionOptionName = undefined;
}

/**
Expand Down

0 comments on commit b488e6e

Please sign in to comment.