chore: Better "use"

Signed-off-by: Tim Hårek Andreassen <tim@harek.no>
This commit is contained in:
Tim Hårek Andreassen 2024-09-29 20:31:42 +02:00
parent d59a69212e
commit 1e6eaa4b4d
No known key found for this signature in database
GPG key ID: E59C7734F0E10EB5

View file

@ -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 <location>",
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() {