chore: Better "use"
Signed-off-by: Tim Hårek Andreassen <tim@harek.no>
This commit is contained in:
parent
d59a69212e
commit
1e6eaa4b4d
1 changed files with 3 additions and 9 deletions
12
cmd/now.go
12
cmd/now.go
|
@ -2,7 +2,6 @@ package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"git.sr.ht/~timharek/yr-go/yr"
|
"git.sr.ht/~timharek/yr-go/yr"
|
||||||
|
@ -10,16 +9,11 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var nowCmd = &cobra.Command{
|
var nowCmd = &cobra.Command{
|
||||||
Use: "now",
|
Use: "now <location>",
|
||||||
Aliases: []string{"current", "n"},
|
Aliases: []string{"current", "n"},
|
||||||
Short: "Get current forecasted weather",
|
Short: "Get current forecasted weather",
|
||||||
Args: func(cmd *cobra.Command, args []string) error {
|
Args: cobra.ExactArgs(1),
|
||||||
if len(args) < 1 || len(args) > 1 {
|
Run: now,
|
||||||
return errors.New("Need a maximum of one argument")
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
},
|
|
||||||
Run: now,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|
Loading…
Reference in a new issue