44 "reflect"
55 "strings"
66
7- "github.com/urfave/cli/v2"
87 "github.com/fatih/structs"
8+ "github.com/urfave/cli/v2"
99)
1010
1111func GenerateFlags (options ... interface {}) (flags []cli.Flag , mappings map [string ]string , err error ) {
@@ -31,22 +31,21 @@ func GenerateFlags(options ...interface{}) (flags []cli.Flag, mappings map[strin
3131 switch field .Kind () {
3232 case reflect .String :
3333 flags = append (flags , & cli.StringFlag {
34- Name : flagName ,
35- Value : field .Value ().(string ),
36- Usage : flagDescription ,
34+ Name : flagName ,
35+ Value : field .Value ().(string ),
36+ Usage : flagDescription ,
3737 })
3838 case reflect .Bool :
3939 flags = append (flags , & cli.BoolFlag {
40- Name : flagName ,
41- Usage : flagDescription ,
40+ Name : flagName ,
41+ Usage : flagDescription ,
4242 EnvVars : []string {envName },
43-
4443 })
4544 case reflect .Int :
4645 flags = append (flags , & cli.IntFlag {
47- Name : flagName ,
48- Value : field .Value ().(int ),
49- Usage : flagDescription ,
46+ Name : flagName ,
47+ Value : field .Value ().(int ),
48+ Usage : flagDescription ,
5049 EnvVars : []string {envName },
5150 })
5251 }
0 commit comments