diff --git a/src/command.ts b/src/command.ts index 1d49110c9..45ec4fd38 100644 --- a/src/command.ts +++ b/src/command.ts @@ -136,7 +136,7 @@ export default abstract class Command { static set globalFlags(flags: Interfaces.FlagInput) { this._globalFlags = Object.assign({}, this.globalFlags, flags) - this.flags = this.globalFlags + this.flags = {} // force the flags setter to run } /** A hash of flags for the command */ @@ -147,7 +147,7 @@ export default abstract class Command { } static set flags(flags: Interfaces.FlagInput) { - this._flags = Object.assign({}, this.globalFlags, flags) + this._flags = Object.assign({}, this._flags ?? {}, this.globalFlags, flags) } id: string | undefined