refactor main

Signed-off-by: Hadi <[email protected]>
This commit is contained in:
Hadi
2025-05-28 09:56:03 +02:00
parent 9a825bc7cc
commit befb546292
2 changed files with 42 additions and 46 deletions
+16
View File
@@ -0,0 +1,16 @@
package main
import (
"strings"
flag "github.com/spf13/pflag"
)
func wordSepNormalizeFunc(f *flag.FlagSet, name string) flag.NormalizedName {
from := []string{".", "_"}
to := "-"
for _, sep := range from {
name = strings.ReplaceAll(name, sep, to)
}
return flag.NormalizedName(name)
}