mirror of
https://github.com/yudai/gotty.git
synced 2026-01-04 16:48:50 +01:00
Revert "Use v2 of urfave/cli"
This reverts commit 17df897c32.
That did not work *at all*... We really need some tests for all of
this.
This commit is contained in:
parent
17df897c32
commit
f3af8fcafd
4 changed files with 38 additions and 38 deletions
|
|
@ -8,7 +8,7 @@ import (
|
|||
"strings"
|
||||
|
||||
"github.com/fatih/structs"
|
||||
"github.com/urfave/cli/v2"
|
||||
"github.com/urfave/cli"
|
||||
"github.com/yudai/hcl"
|
||||
|
||||
"github.com/sorenisanerd/gotty/pkg/homedir"
|
||||
|
|
@ -36,24 +36,24 @@ func GenerateFlags(options ...interface{}) (flags []cli.Flag, mappings map[strin
|
|||
|
||||
switch field.Kind() {
|
||||
case reflect.String:
|
||||
flags = append(flags, &cli.StringFlag{
|
||||
Name: flagName,
|
||||
Value: field.Value().(string),
|
||||
Usage: flagDescription,
|
||||
EnvVars: []string{envName},
|
||||
flags = append(flags, cli.StringFlag{
|
||||
Name: flagName,
|
||||
Value: field.Value().(string),
|
||||
Usage: flagDescription,
|
||||
EnvVar: envName,
|
||||
})
|
||||
case reflect.Bool:
|
||||
flags = append(flags, &cli.BoolFlag{
|
||||
Name: flagName,
|
||||
Usage: flagDescription,
|
||||
EnvVars: []string{envName},
|
||||
flags = append(flags, cli.BoolFlag{
|
||||
Name: flagName,
|
||||
Usage: flagDescription,
|
||||
EnvVar: envName,
|
||||
})
|
||||
case reflect.Int:
|
||||
flags = append(flags, &cli.IntFlag{
|
||||
Name: flagName,
|
||||
Value: field.Value().(int),
|
||||
Usage: flagDescription,
|
||||
EnvVars: []string{envName},
|
||||
flags = append(flags, cli.IntFlag{
|
||||
Name: flagName,
|
||||
Value: field.Value().(int),
|
||||
Usage: flagDescription,
|
||||
EnvVar: envName,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue