chore: move print QR func to utils

This commit is contained in:
tobyxdd
2023-07-14 15:44:37 -07:00
parent e21e5c67a8
commit 6aa60e12d1
2 changed files with 12 additions and 7 deletions

View File

@@ -10,7 +10,6 @@ import (
"sync"
"time"
"github.com/mdp/qrterminal/v3"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"go.uber.org/zap"
@@ -264,12 +263,7 @@ func runClient(cmd *cobra.Command, args []string) {
uri := config.ShareURI()
logger.Info("use this URI to share your server", zap.String("uri", uri))
if showQR {
qrterminal.GenerateWithConfig(uri, qrterminal.Config{
Level: qrterminal.L,
Writer: os.Stdout,
BlackChar: qrterminal.BLACK,
WhiteChar: qrterminal.WHITE,
})
printQR(uri)
}
// Modes