diff --git a/src/ux/multiStageOutput.ts b/src/ux/multiStageOutput.ts index a6483137b..85141a2f8 100644 --- a/src/ux/multiStageOutput.ts +++ b/src/ux/multiStageOutput.ts @@ -7,12 +7,12 @@ import { MultiStageOutput as OclifMultiStageOutput, MultiStageOutputOptions } from '@oclif/multi-stage-output'; -/** - * This class is a light wrapper around MultiStageOutput that allows us to - * automatically suppress any actions if `--json` flag is present. - */ export class MultiStageOutput> extends OclifMultiStageOutput { public constructor(opts: MultiStageOutputOptions & { outputEnabled: boolean }) { - if (opts.outputEnabled) super(opts); + const { outputEnabled, ...rest } = opts; + super(rest); + if (!outputEnabled) { + this.stop(); + } } }