diff --git a/lib/command.js b/lib/command.js index f7e7a2ca2..c19197787 100644 --- a/lib/command.js +++ b/lib/command.js @@ -79,15 +79,15 @@ class Command extends EventEmitter { this._helpConfiguration = {}; this._optionValuesProxy = new Proxy(this._optionValues, { - set(_, key) { - throw new Error(`Tried to set value of option ${key} directly. -Use .setOptionValue() or .setOptionValueWithSource() instead`); + set: (_, key, value) => { + this.setOptionValue(key, value); + return true; }, - deleteProperty(_, key) { + deleteProperty: (_, key) => { throw new Error(`Tried to delete value of option ${key}. Option value deletion is not supported`); }, - defineProperty(_, key) { + defineProperty: (_, key) => { throw new Error(`Tried to configure value of option ${key} using - Object.defineProperty(), - or Object.defineProperties(),