From b488e6e08f6270c7992a9cc4f643401a7d273949 Mon Sep 17 00:00:00 2001 From: Wee Bit Date: Thu, 3 Aug 2023 20:06:13 +0300 Subject: [PATCH] Initialize _version, _versionOptionName in constructor 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 #1919 (and previously in #1921) is adopted --- lib/command.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/command.js b/lib/command.js index e014d957f..ca4a45ecb 100644 --- a/lib/command.js +++ b/lib/command.js @@ -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; } /**