remove interactive output type

This commit is contained in:
Finn 2021-01-31 05:06:09 -08:00
parent c824084ea9
commit 9143f54783
3 changed files with 8 additions and 9 deletions

View file

@ -20,7 +20,6 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"gitlab.com/signald/signald-go/cmd/signaldctl/common"
"gitlab.com/signald/signald-go/signald/client-protocol/v0" "gitlab.com/signald/signald-go/signald/client-protocol/v0"
) )
@ -50,7 +49,7 @@ var (
if actionVerify { if actionVerify {
actionCount++ 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") log.Fatal("invalid arguments: must select exactly one of --request-code, --verify or --link")
} }

View file

@ -63,7 +63,7 @@ func link() {
} else { } else {
t.Render() t.Render()
} }
case common.OutputFormatInteractive, common.OutputFormatDefault: case common.OutputFormatQR, common.OutputFormatDefault:
qrterminal.Generate(uri.Data.URI, qrterminal.M, os.Stdout) qrterminal.Generate(uri.Data.URI, qrterminal.M, os.Stdout)
default: default:
log.Fatal("unsupported output format") log.Fatal("unsupported output format")

View file

@ -1,10 +1,10 @@
package common package common
const ( const (
OutputFormatDefault = "default" OutputFormatDefault = "default"
OutputFormatCSV = "csv" OutputFormatCSV = "csv"
OutputFormatTable = "table" OutputFormatTable = "table"
OutputFormatJSON = "json" OutputFormatJSON = "json"
OutputFormatYAML = "yaml" OutputFormatYAML = "yaml"
OutputFormatInteractive = "interactive" OutputFormatQR = "qr"
) )