GitOps for k8s
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

main.go 621B

123456789101112131415161718192021222324252627282930
  1. package main
  2. import (
  3. "os"
  4. "github.com/pkg/errors"
  5. fluxerr "github.com/fluxcd/flux/errors"
  6. )
  7. func run(args []string) int {
  8. rootCmd := newRoot().Command()
  9. rootCmd.SetArgs(args)
  10. if cmd, err := rootCmd.ExecuteC(); err != nil {
  11. // Format flux-specific errors. They can come wrapped,
  12. // so we use the cause instead.
  13. if cause, ok := errors.Cause(err).(*fluxerr.Error); ok {
  14. cmd.Println("== Error ==\n\n" + cause.Help)
  15. } else {
  16. cmd.Println("Error: " + err.Error())
  17. cmd.Printf("Run '%v --help' for usage.\n", cmd.CommandPath())
  18. }
  19. return 1
  20. }
  21. return 0
  22. }
  23. func main() {
  24. os.Exit(run(os.Args[1:]))
  25. }