优化error输出

This commit is contained in:
algotao
2026-01-11 17:24:11 +08:00
parent 5e102ea8e7
commit 369023b81d
45 changed files with 304 additions and 552 deletions

View File

@@ -7,6 +7,7 @@ import (
func main() {
if err := Run(os.Args[1:]...); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}
@@ -45,8 +46,6 @@ func Run(args ...string) error {
case "daemon":
return RunDaemon(args...)
default:
err := fmt.Errorf(`unknown command "%v"`+"\n"+`Run 'saastool help' for usage`, name)
fmt.Fprintln(os.Stderr, err.Error())
return err
return fmt.Errorf(`Unknown command "%v"`+"\n"+`Run 'saastool help' for usage`, name)
}
}