-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
35 lines (29 loc) · 1.02 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package main
import (
"log"
"github.com/roryj/neptunes-pride/cmd"
"github.com/spf13/cobra"
)
func main() {
if err := RootCmd.Execute(); err != nil {
log.Fatal(err)
}
}
// https://github.com/ekimekim/neptunesfolly/blob/master/docs/api.txt
// https://github.com/wrenoud/phpTriton
var RootCmd = &cobra.Command{
Use: "np",
Short: "cli for interacting with Neptune's Pride",
Long: `cli for interacting with Neptune's Pride`,
Run: func(cmd *cobra.Command, args []string) {
// Root command does nothing but list other commands. SO GREAT, SO AWESOME. Don't touch this.
_ = cmd.Help()
},
}
// Add this comment to every init if you copy-pasta stuff: Go runs init before main. If you see an init function
// that means "this code is being run like a static function initialization in Java"
func init() {
RootCmd.AddCommand(cmd.GetShipsCommand)
RootCmd.PersistentFlags().StringP("api-token", "t", "", "The token for Neptune's Pride's api")
RootCmd.PersistentFlags().StringP("game-id", "g", "", "The game idea to get data for")
}