diff --git a/api.go b/api.go index a480886bbf6f94f1234c819759d051e9bd00220c..4b4cc8d268f8f957fca91016d219c3796bdf2c1c 100644 --- a/api.go +++ b/api.go @@ -14,32 +14,14 @@ import ( // ExecuteWithShadow executes the command line arguments and calls the functions. func ExecuteWithShadow[C any, D any](cmd C, cnf D) *Settings[C] { - s := execute(cmd, cnf, os.Args[0], os.Args[1:]) - - if s.HasErrors() { - for _, e := range s.Errors() { - fmt.Println(e) - } - } - return s + return execute(cmd, cnf, os.Args[0], os.Args[1:]) } type noShadow struct{} // Execute executes the command line arguments and calls the functions. func Execute[C any](cmd C) *Settings[C] { - s := execute(cmd, noShadow{}, os.Args[0], os.Args[1:]) - if s.HasErrors() { - for _, e := range s.Errors() { - fmt.Println(e) - } - } - - if s.hint != "" { - fmt.Println(s.hint) - } - - return s + return execute(cmd, noShadow{}, os.Args[0], os.Args[1:]) } func (s *Settings[C]) PrintFlagOutput() {