21 lines
760 B
Go
Raw Normal View History

2024-05-27 15:10:26 +02:00
package services
import (
"flag"
2024-05-27 15:13:11 +02:00
"wazuh-notify/services/log"
2024-05-27 15:10:26 +02:00
"wazuh-notify/types"
)
func ParseFlags(params types.Params) types.Params {
2024-05-27 15:49:04 +02:00
//Set command line flags
2024-05-27 15:10:26 +02:00
flag.StringVar(&params.General.Click, "click", params.General.Click, "is a link (URL) that can be followed by tapping/clicking inside the message. Default is https://google.com.")
flag.StringVar(&params.General.Sender, "sender", params.General.Sender+" Golang", "is the sender of the message, either an app name or a person. The default is \"Security message\".")
flag.StringVar(&params.General.Targets, "targets", params.General.Targets, "is a list of targets to send notifications to. Default is \"discord\".")
2024-05-27 15:49:04 +02:00
//Get flag values
2024-05-27 15:10:26 +02:00
flag.Parse()
2024-05-27 15:39:50 +02:00
log.Log("flags loaded")
2024-05-27 15:10:26 +02:00
return params
}