mirror of
https://github.com/hanzoai/o11y-foundry.git
synced 2026-10-30 18:26:45 +00:00
38 lines
721 B
Go
38 lines
721 B
Go
package main
|
|
|
|
import (
|
|
"os"
|
|
|
|
foundryerrors "github.com/hanzoai/o11y-foundry/internal/errors"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
func main() {
|
|
rootCmd := &cobra.Command{
|
|
Use: "foundryctl",
|
|
SilenceUsage: true,
|
|
CompletionOptions: cobra.CompletionOptions{
|
|
DisableDefaultCmd: true,
|
|
},
|
|
PersistentPreRunE: newRoot,
|
|
}
|
|
|
|
// Register configuration.
|
|
commonCfg.RegisterFlags(rootCmd)
|
|
poursCfg.RegisterFlags(rootCmd)
|
|
|
|
// Register commands.
|
|
registerGaugeCmd(rootCmd)
|
|
registerForgeCmd(rootCmd)
|
|
registerCastCmd(rootCmd)
|
|
registerGenCmd(rootCmd)
|
|
registerCatalogCmd(rootCmd)
|
|
registerVersionCmd(rootCmd)
|
|
|
|
defer closeRoot()
|
|
|
|
if err := rootCmd.Execute(); err != nil {
|
|
os.Exit(foundryerrors.ExitCode(err))
|
|
}
|
|
}
|