Initial Commit
This commit is contained in:
commit
87a522daab
22 changed files with 1555 additions and 0 deletions
30
cmd/root.go
Normal file
30
cmd/root.go
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
package cmd
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"git.skdevstudios.com/SK-Development-Studios/go-cal-tui/tui"
|
||||
"git.skdevstudios.com/SK-Development-Studios/go-cal-tui/config"
|
||||
"git.skdevstudios.com/SK-Development-Studios/go-cal-tui/internal/logger"
|
||||
)
|
||||
|
||||
var rootCmd = &cobra.Command{
|
||||
Use: "go-cal-tui",
|
||||
Short: "go-cal-tui, A calendar tui written in go",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
if err := tui.Run(); err != nil {
|
||||
logger.Log.Errorf("Error: %s", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
func Execute() {
|
||||
config.Init()
|
||||
cobra.CheckErr(rootCmd.Execute())
|
||||
}
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(versionCmd)
|
||||
}
|
||||
15
cmd/version.go
Normal file
15
cmd/version.go
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var versionCmd = &cobra.Command{
|
||||
Use: "version",
|
||||
Short: "Print the version number of go-cal-tui",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
fmt.Println("go-cal-tui ~ 0.0.1")
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue