add flags for bin colors
This commit is contained in:
parent
cb42bee299
commit
e88668207f
2 changed files with 30 additions and 7 deletions
11
main.go
11
main.go
|
|
@ -11,6 +11,11 @@ func main() {
|
|||
var args struct {
|
||||
Street string `arg:"positional,required"`
|
||||
Home int `arg:"positional,required"`
|
||||
Pink bool `arg:"--pink"`
|
||||
Yellow bool `arg:"--yellow"`
|
||||
Blue bool `arg:"--blue"`
|
||||
Gray bool `arg:"--gray"`
|
||||
Brown bool `arg:"--brown"`
|
||||
}
|
||||
|
||||
parser, err := arg.NewParser(arg.Config{}, &args)
|
||||
|
|
@ -20,6 +25,10 @@ func main() {
|
|||
}
|
||||
parser.MustParse(os.Args[1:])
|
||||
|
||||
if !(args.Pink || args.Yellow || args.Blue || args.Gray || args.Brown) {
|
||||
args.Pink, args.Yellow, args.Blue, args.Gray, args.Brown = true, true, true, true, true
|
||||
}
|
||||
|
||||
NotifyChannel = fmt.Sprintf("%s-%d", args.Street, args.Home)
|
||||
|
||||
streetNumbers, err := GetStreetNumbers()
|
||||
|
|
@ -43,7 +52,7 @@ func main() {
|
|||
return
|
||||
}
|
||||
|
||||
err = SendAwlNotification(tomorrow)
|
||||
err = SendAwlNotification(tomorrow, args.Pink, args.Yellow, args.Blue, args.Gray, args.Brown)
|
||||
if err != nil {
|
||||
_ = SendErr(err)
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue