Skip to content

Commit ab89aa5

Browse files
committed
feat(cli): enhance logo display logic and update logo information
1 parent ea18631 commit ab89aa5

2 files changed

Lines changed: 22 additions & 2 deletions

File tree

src/client/acontext-cli/internal/logo/logo.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ const Logo = `╔─────────────────────
88
│ ██║ ██║╚██████╗╚██████╔╝██║ ╚████║ ██║ ███████╗██╔╝ ██╗ ██║ │
99
│ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═╝ ╚══════╝╚═╝ ╚═╝ ╚═╝ │
1010
│ Feedback: https://discord.acontext.io/ │
11+
│ Dashboard: https://dash.acontext.io/ │
1112
╚───────────────────────────────────────────────────────────────────────╝`

src/client/acontext-cli/main.go

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,14 @@ func GetVersion() string {
2626
}
2727

2828
func main() {
29-
// Print logo on first run (skip for help commands)
29+
// Print logo on first run (skip for help commands and root command)
3030
shouldSkipLogo := false
31-
if len(os.Args) > 1 {
31+
32+
// Check if running root command (no subcommand)
33+
if len(os.Args) == 1 {
34+
// No arguments - will execute rootCmd.Run, which prints logo
35+
shouldSkipLogo = true
36+
} else if len(os.Args) > 1 {
3237
firstArg := os.Args[1]
3338
// Skip logo for help flags
3439
if firstArg == "--help" || firstArg == "-h" {
@@ -42,7 +47,21 @@ func main() {
4247
if firstArg == "help" {
4348
shouldSkipLogo = true
4449
}
50+
// Skip logo if executing root command (first arg is not a known subcommand)
51+
knownSubcommands := []string{"create", "docker", "version", "upgrade", "help"}
52+
isSubcommand := false
53+
for _, subcmd := range knownSubcommands {
54+
if firstArg == subcmd {
55+
isSubcommand = true
56+
break
57+
}
58+
}
59+
if !isSubcommand {
60+
// Not a known subcommand, will execute rootCmd.Run which prints logo
61+
shouldSkipLogo = true
62+
}
4563
}
64+
4665
if !shouldSkipLogo {
4766
fmt.Println(logo.Logo)
4867
}

0 commit comments

Comments
 (0)