From 1e6eaa4b4dc05fed218017c575123155e2f60f06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20H=C3=A5rek=20Andreassen?= Date: Sun, 29 Sep 2024 20:31:42 +0200 Subject: [PATCH] chore: Better "use" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tim HĂ„rek Andreassen --- cmd/now.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/cmd/now.go b/cmd/now.go index a84bfb3..7c2aaa3 100644 --- a/cmd/now.go +++ b/cmd/now.go @@ -2,7 +2,6 @@ package cmd import ( "encoding/json" - "errors" "fmt" "git.sr.ht/~timharek/yr-go/yr" @@ -10,16 +9,11 @@ import ( ) var nowCmd = &cobra.Command{ - Use: "now", + Use: "now ", Aliases: []string{"current", "n"}, Short: "Get current forecasted weather", - Args: func(cmd *cobra.Command, args []string) error { - if len(args) < 1 || len(args) > 1 { - return errors.New("Need a maximum of one argument") - } - return nil - }, - Run: now, + Args: cobra.ExactArgs(1), + Run: now, } func init() {