embeded templates

This commit is contained in:
steven carpenter 2025-07-25 16:01:48 -04:00
parent bf78461bbb
commit 9e4d1a6a28
18 changed files with 63 additions and 58 deletions

View file

@ -0,0 +1,30 @@
package cmd
import (
"os"
"github.com/spf13/cobra"
"{{.ModName}}/tui"
"{{.ModName}}/config"
"{{.ModName}}/internal/logger"
)
var rootCmd = &cobra.Command{
Use: "{{.PackageName}}",
Short: "{{.PackageName}}, {{.ProgramDesc}}",
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)
}

View 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 {{.PackageName}}",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("{{.PackageName}} ~ {{.ProgramVersion}}")
},
}