my urfave/cli version is
v1.22.4
Checklist
Dependency Management
- My project is using go modules.
- My project is using vendoring.
Describe the bug
When using alternates in flag names altsrc does not copy the flag value.
To reproduce
package main
import (
"fmt"
"log"
"os"
"github.com/urfave/cli"
"github.com/urfave/cli/altsrc"
)
var (
test int
)
func main() {
app := cli.NewApp()
flags := []cli.Flag{
altsrc.NewIntFlag(cli.IntFlag{Name: "test,t", Destination: &test}),
cli.StringFlag{Name: "load"},
}
app.Action = func(c *cli.Context) error {
fmt.Printf("Have test value: %d\n", test)
return nil
}
app.Before = altsrc.InitInputSourceWithContext(flags, altsrc.NewYamlSourceFromFlagFunc("load"))
app.Flags = flags
err := app.Run(os.Args)
if err != nil {
log.Fatal(err)
}
}
echo test: 1 >conf
GO111MODULE=on go run test.go --load conf
Observed behavior
Expected behavior
Additional context
Previously reported in #711
my urfave/cli version is
v1.22.4
Checklist
Dependency Management
Describe the bug
When using alternates in flag names altsrc does not copy the flag value.
To reproduce
Observed behavior
Expected behavior
Additional context
Previously reported in #711