Skip to content

Commit 1005fd1

Browse files
committed
chore: bump version
1 parent fad3f5b commit 1005fd1

1 file changed

Lines changed: 33 additions & 12 deletions

File tree

cmd/root.go

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,43 @@ import (
77
"fmt"
88
"runtime"
99

10-
"github.com/fatih/color"
10+
box "github.com/box-cli-maker/box-cli-maker/v3"
1111
"github.com/spf13/cobra"
1212
"github.com/two-tech-dev/endgit-cli/internal/log"
1313
)
1414

15-
var endgit = color.New(color.FgCyan, color.Bold).Sprint("EndGit")
15+
var endgit = "EndGit"
16+
17+
var bannerBox = box.NewBox().
18+
Style(box.Bold).
19+
Padding(2, 1).
20+
TitlePosition(box.Top).
21+
ContentAlign(box.Center).
22+
Color(box.Cyan).
23+
TitleColor(box.BrightCyan).
24+
ContentColor(box.BrightWhite)
25+
26+
var versionBox = box.NewBox().
27+
Style(box.Single).
28+
Padding(2, 0).
29+
TitlePosition(box.Inside).
30+
ContentAlign(box.Left).
31+
Color(box.Cyan).
32+
TitleColor(box.BrightCyan).
33+
ContentColor(box.BrightWhite)
1634

1735
// Version is set at build time via -ldflags.
1836
// Falls back to "dev" for local builds.
19-
var Version = "0.1.7"
37+
var Version = "0.1.8"
2038

2139
var rootCmd = &cobra.Command{
2240
Use: "endgit",
2341
Version: Version,
2442
Short: endgit + " - The package manager for Endstone plugins",
25-
Long: endgit + ` - The package manager for Endstone plugins
26-
27-
A fast and modern CLI for managing Endstone plugins.
28-
Install, update, publish, and search plugins directly from your terminal.`,
43+
Long: func() string {
44+
out := bannerBox.MustRender(endgit, "The package manager for Endstone plugins\n\nA fast and modern CLI for managing Endstone plugins.\nInstall, update, publish, and search plugins\n directly from your terminal.")
45+
return out
46+
}(),
2947
}
3048

3149
// Execute runs the root command
@@ -42,9 +60,12 @@ func init() {
4260
rootCmd.SilenceErrors = true
4361
rootCmd.SilenceUsage = true
4462

45-
// Custom version template with OS/arch info
46-
rootCmd.SetVersionTemplate(fmt.Sprintf(
47-
"%s CLI %s (%s/%s)\n",
48-
endgit, Version, runtime.GOOS, runtime.GOARCH,
49-
))
63+
// Custom version template with OS/arch info in a box
64+
rootCmd.SetVersionTemplate(func() string {
65+
out := versionBox.MustRender(
66+
endgit+" CLI",
67+
fmt.Sprintf("Version: %s\nPlatform: %s/%s", Version, runtime.GOOS, runtime.GOARCH),
68+
)
69+
return out
70+
}())
5071
}

0 commit comments

Comments
 (0)