From 54939817e0b9fd89898274efc1913886ad03ac10 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Wed, 31 Aug 2022 12:41:34 +0430 Subject: [PATCH] feat: fatal if algorithm is empty --- internal/cmd/encode/encode.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/cmd/encode/encode.go b/internal/cmd/encode/encode.go index d87dad0..801cbe3 100644 --- a/internal/cmd/encode/encode.go +++ b/internal/cmd/encode/encode.go @@ -98,6 +98,9 @@ func flagOptions(c *cobra.Command) model.Encode { iss, _ := c.Flags().GetString("issuer") aud, _ := c.Flags().GetString("audience") alg, _ := c.Flags().GetString("algorithm") + if alg == "" { + pterm.Fatal.Println("you have to specify algorithm") + } return model.Encode{ Algorithm: alg,