Merge branch 'report_source_of_parse_errors' of ssh://github.com/mostynb/cli into mostynb-report_source_of_parse_errors

This commit is contained in:
2022-04-19 19:41:57 -04:00
17 changed files with 53 additions and 50 deletions

View File

@@ -133,9 +133,9 @@ func (f *TimestampFlag) Apply(set *flag.FlagSet) error {
f.Destination.SetLayout(f.Layout)
}
if val, ok := flagFromEnvOrFile(f.EnvVars, f.FilePath); ok {
if val, source, found := flagFromEnvOrFile(f.EnvVars, f.FilePath); found {
if err := f.Value.Set(val); err != nil {
return fmt.Errorf("could not parse %q as timestamp value for flag %s: %s", val, f.Name, err)
return fmt.Errorf("could not parse %q as timestamp value from %s for flag %s: %s", val, source, f.Name, err)
}
f.HasBeenSet = true
}