taskcafe/internal/commands/commands.go

41 lines
752 B
Go
Raw Normal View History

2020-07-16 01:20:08 +02:00
package commands
import (
"fmt"
"github.com/spf13/cobra"
)
2020-08-07 03:50:35 +02:00
const TaskcafeConfDirEnvName = "TASKCAFE_CONFIG_DIR"
2020-07-16 01:20:08 +02:00
2020-08-07 03:50:35 +02:00
const TaskcafeAppConf = "taskcafe"
2020-07-16 01:20:08 +02:00
2020-08-07 03:50:35 +02:00
const mainDescription = `Taskcafé is an open soure project management
2020-07-16 01:20:08 +02:00
system written in Golang & React.`
var (
version = "dev"
commit = "none"
date = "unknown"
)
var versionTemplate = fmt.Sprintf(`Version: %s
Commit: %s
Built: %s`, version, commit, date+"\n")
var commandError error
var configDir string
var verbose bool
var noColor bool
var rootCmd = &cobra.Command{
2020-08-07 03:50:35 +02:00
Use: "taskcafe",
2020-07-16 01:20:08 +02:00
Long: mainDescription,
Version: version,
}
func Execute() {
rootCmd.SetVersionTemplate(versionTemplate)
rootCmd.AddCommand(newWebCmd(), newMigrateCmd(), newTokenCmd())
2020-07-16 01:20:08 +02:00
rootCmd.Execute()
}