30 lines
484 B
Go
30 lines
484 B
Go
package cmd
|
|
|
|
import (
|
|
"git-roast/internal/config"
|
|
"os"
|
|
"runtime/debug"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var rootCmd = &cobra.Command{
|
|
Use: "git-roast",
|
|
Short: "Decentralized code review platform.",
|
|
}
|
|
|
|
func Execute() {
|
|
err := rootCmd.Execute()
|
|
if err != nil {
|
|
os.Exit(1)
|
|
}
|
|
}
|
|
|
|
func init() {
|
|
if info, ok := debug.ReadBuildInfo(); ok {
|
|
rootCmd.Version = info.Main.Version
|
|
}
|
|
|
|
rootCmd.PersistentFlags().BoolVar(&config.Verbose, "verbose", false, "verbose output to stdout")
|
|
}
|