Use flag.Args() to handle flag + normal arguments

This commit is contained in:
2023-12-20 08:17:44 -06:00
parent f87e6d31fa
commit a6e47a33e6

View File

@@ -158,8 +158,9 @@ func main() {
log.Infof("Redis connection established (%s)", ping_result)
command := ""
if len(os.Args) > 1 {
command = os.Args[1]
args := flag.Args()
if len(args) > 1 {
command = args[1]
}
switch command {