From 9143f547839417de7270355a6eae93e550aad995 Mon Sep 17 00:00:00 2001 From: Finn Date: Sun, 31 Jan 2021 05:06:09 -0800 Subject: [PATCH] remove interactive output type --- cmd/signaldctl/cmd/create/account/account.go | 3 +-- cmd/signaldctl/cmd/create/account/link.go | 2 +- cmd/signaldctl/common/output-formats.go | 12 ++++++------ 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/cmd/signaldctl/cmd/create/account/account.go b/cmd/signaldctl/cmd/create/account/account.go index 90dd1d5..a911a56 100644 --- a/cmd/signaldctl/cmd/create/account/account.go +++ b/cmd/signaldctl/cmd/create/account/account.go @@ -20,7 +20,6 @@ import ( "github.com/spf13/cobra" - "gitlab.com/signald/signald-go/cmd/signaldctl/common" "gitlab.com/signald/signald-go/signald/client-protocol/v0" ) @@ -50,7 +49,7 @@ var ( if actionVerify { actionCount++ } - if actionCount > 1 || (actionCount == 0 && common.OutputFormat != common.OutputFormatInteractive) { + if actionCount > 1 { log.Fatal("invalid arguments: must select exactly one of --request-code, --verify or --link") } diff --git a/cmd/signaldctl/cmd/create/account/link.go b/cmd/signaldctl/cmd/create/account/link.go index b490e4f..a2b5452 100644 --- a/cmd/signaldctl/cmd/create/account/link.go +++ b/cmd/signaldctl/cmd/create/account/link.go @@ -63,7 +63,7 @@ func link() { } else { t.Render() } - case common.OutputFormatInteractive, common.OutputFormatDefault: + case common.OutputFormatQR, common.OutputFormatDefault: qrterminal.Generate(uri.Data.URI, qrterminal.M, os.Stdout) default: log.Fatal("unsupported output format") diff --git a/cmd/signaldctl/common/output-formats.go b/cmd/signaldctl/common/output-formats.go index 3e5aa62..61440ec 100644 --- a/cmd/signaldctl/common/output-formats.go +++ b/cmd/signaldctl/common/output-formats.go @@ -1,10 +1,10 @@ package common const ( - OutputFormatDefault = "default" - OutputFormatCSV = "csv" - OutputFormatTable = "table" - OutputFormatJSON = "json" - OutputFormatYAML = "yaml" - OutputFormatInteractive = "interactive" + OutputFormatDefault = "default" + OutputFormatCSV = "csv" + OutputFormatTable = "table" + OutputFormatJSON = "json" + OutputFormatYAML = "yaml" + OutputFormatQR = "qr" )