From e4f4c25ece97bd50030d583726f000f23eb79d87 Mon Sep 17 00:00:00 2001 From: Stavros Date: Thu, 26 Feb 2026 17:11:24 +0200 Subject: [PATCH] refactor: remove the need of the logger in the create oidc client cmd --- cmd/tinyauth/create_oidc_client.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cmd/tinyauth/create_oidc_client.go b/cmd/tinyauth/create_oidc_client.go index 0786d7a..862119e 100644 --- a/cmd/tinyauth/create_oidc_client.go +++ b/cmd/tinyauth/create_oidc_client.go @@ -1,12 +1,12 @@ package main import ( + "errors" "fmt" "regexp" "github.com/google/uuid" "github.com/steveiliop56/tinyauth/internal/utils" - "github.com/steveiliop56/tinyauth/internal/utils/tlog" "github.com/traefik/paerser/cli" ) @@ -18,10 +18,8 @@ func createOidcClientCmd() *cli.Command { Resources: nil, AllowArg: true, Run: func(args []string) error { - tlog.NewSimpleLogger().Init() - if len(args) == 0 { - tlog.App.Fatal().Msg("Client name is required. Use tinyauth oidc create ") + return errors.New("client name is required. use tinyauth oidc create ") } clientName := args[0] @@ -29,7 +27,7 @@ func createOidcClientCmd() *cli.Command { match, err := regexp.MatchString("^[a-zA-Z0-9-]*$", clientName) if !match || err != nil { - tlog.App.Fatal().Msg("Client name can only contain alphanumeric characters and hyphens") + return errors.New("client name can only contain alphanumeric characters and hyphens") } uuid := uuid.New()