Files
gas-stack/cmd/main.go

36 lines
715 B
Go

package main
import (
"fmt"
"os"
"github.com/spf13/cobra"
"git.offline-twitter.com/offline-labs/gas-stack/pkg/version"
)
const (
GREEN = "\033[0;32m"
RED = "\033[0;31m"
RESET = "\033[0m"
)
func main() {
rootCmd := &cobra.Command{
Use: "gas",
Version: version.String(),
SilenceErrors: true,
SilenceUsage: true,
}
// Print a bare version string ("v0.0.4"), rather than cobra's "gas version v0.0.4".
rootCmd.SetVersionTemplate("{{.Version}}\n")
rootCmd.AddCommand(sqliteLint)
rootCmd.AddCommand(cmdInit)
rootCmd.AddCommand(generateModel)
rootCmd.AddCommand(cmdVersion)
if err := rootCmd.Execute(); err != nil {
fmt.Println(RED + err.Error() + RESET)
os.Exit(1)
}
}