-
Notifications
You must be signed in to change notification settings - Fork 0
/
flags.go
40 lines (32 loc) · 1011 Bytes
/
flags.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
36
37
38
39
40
package main
import (
"github.com/alecthomas/kong"
)
var CLI struct {
Records struct {
List struct {
ZoneId string `arg:"" required:""`
} `cmd:"" group:"Manage records:" help:"List all A records in the hosted zone"`
Activate struct {
ZoneId string `arg:"" required:""`
ResourceName string `arg:"" required:""`
} `cmd:"" group:"Manage records:" help:"Activate record for DDNS updates"`
Deactivate struct {
ResourceName string `arg:"" required:""`
} `cmd:"" group:"Manage records:" help:"Deactivate record for DDNS updates"`
Update struct {
ResourceName string `arg:"" required:""`
IP string `arg:"" optional:""`
} `cmd:"" group:"Manage records:" help:"Manually update IP address of the record"`
} `cmd:""`
Zones struct {
List struct{} `cmd:"" group:"Manage hosted zones:"`
} `cmd:""`
Server struct {
Run struct{} `cmd:"" group:"Server: Run DDNS server"`
} `cmd:""`
}
func parseFlags() string {
ctx := kong.Parse(&CLI)
return ctx.Command()
}