Add config file support to CLI parser

Add -f/--config-file flag for loading YAML configs from local or remote sources. Fix error handling to return unmatched errors.
This commit is contained in:
2025-08-28 23:57:00 +04:00
parent 42335c1178
commit 29b85d5b83
9 changed files with 138 additions and 26 deletions

View File

@@ -12,7 +12,7 @@ import (
func main() {
cliParser := config.NewConfigCLIParser(os.Args)
_, err := cliParser.Parse()
cfg, err := cliParser.Parse()
_ = utils.HandleErrorOrDie(err,
utils.OnSentinelError(types.ErrCLINoArgs, func(err error) error {
@@ -34,6 +34,8 @@ func main() {
return nil
}),
)
fmt.Println(cfg)
}
func printValidationErrors(parserName string, errors ...types.FieldParseError) {