From df25af809ca0bb47423b241e891800aaa0d048ac Mon Sep 17 00:00:00 2001 From: sophia Date: Mon, 16 May 2022 13:52:52 -0500 Subject: [PATCH] Use no-tty flag --- internal/cli/base.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/cli/base.go b/internal/cli/base.go index 94c4a3cda..e8a77d160 100644 --- a/internal/cli/base.go +++ b/internal/cli/base.go @@ -88,8 +88,8 @@ type baseCommand struct { // flagTarget is the machine to target. flagTarget string - // flagTTY is whether the output is interactive - flagTTY bool + // flagNoTTY is whether the output is interactive + flagNoTTY bool // flagConnection contains manual flag-based connection info. flagConnection clicontext.Config @@ -161,7 +161,7 @@ func BaseCommand(ctx context.Context, log hclog.Logger, logOutput io.Writer, opt // Set UI var ui terminal.UI // Set non interactive if the --no-tty flag is provided - if !bc.flagTTY { + if bc.flagNoTTY { ui = terminal.NonInteractiveUI(ctx) } else { // If no ui related flags are set, create a new one @@ -292,7 +292,7 @@ func (c *baseCommand) Init(opts ...Option) (err error) { // Set UI var ui terminal.UI // Set non interactive if the --no-tty flag is provided - if !c.flagTTY { + if c.flagNoTTY { ui = terminal.NonInteractiveUI(c.Ctx) } else { // If no ui related flags are set, use the base config ui @@ -407,9 +407,9 @@ func (c *baseCommand) flagSet(bit flagSetBit, f func([]*component.CommandFlag) [ Type: component.FlagString, }, { - LongName: "tty", + LongName: "no-tty", Description: "Enable non-interactive output", - DefaultValue: "true", + DefaultValue: "false", Type: component.FlagBool, }, }