handle error on parse

This commit is contained in:
Celogeek 2024-12-24 10:49:50 +01:00
parent e435397bc0
commit cc7dfc8d54
Signed by: celogeek
GPG Key ID: 850295F3747870DD

View File

@ -228,7 +228,9 @@ func (c *Converter) isZeroValue(f *flag.Flag, value string) (ok bool, err error)
// Parse all parameters // Parse all parameters
func (c *Converter) Parse() { func (c *Converter) Parse() {
_ = c.Cmd.Parse(os.Args[1:]) if err := c.Cmd.Parse(os.Args[1:]); err != nil {
utils.Fatalf("cannot parse command line options: %v", err)
}
if c.Options.Help { if c.Options.Help {
c.Cmd.Usage() c.Cmd.Usage()
os.Exit(0) os.Exit(0)