-
Notifications
You must be signed in to change notification settings - Fork 17
add flag to allow start ktea without logo #119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 6 commits
e4af8e0
e786e6d
e42ce1b
1c79e0d
33747a7
887fced
2071600
48521b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,6 +44,7 @@ var kconnectTab = tab.Tab{Title: "Kafka Connect", Label: kconnectTabLbl} | |
| var clustersTab = tab.Tab{Title: "Clusters", Label: clustersTabLbl} | ||
|
|
||
| type Model struct { | ||
| logoless bool | ||
| tabs tab.Model | ||
| activeTab tab.Tab | ||
| tabCtrl tabs.TabController | ||
|
|
@@ -82,8 +83,10 @@ func (m *Model) View() string { | |
| } | ||
|
|
||
| var views []string | ||
| logoView := m.renderer.Render(" ___ \n |/ | _ _.\n |\\ | (/_ (_| " + version) | ||
| views = append(views, logoView) | ||
| if !m.logoless { | ||
| logoView := m.renderer.Render(" ___ \n |/ | _ _.\n |\\ | (/_ (_| " + version) | ||
| views = append(views, logoView) | ||
| } | ||
|
|
||
| tabsView := m.tabs.View(m.ktx, m.renderer) | ||
| views = append(views, tabsView) | ||
|
|
@@ -336,9 +339,11 @@ func main() { | |
| var ( | ||
| debugParam bool | ||
| plainFontsParam bool | ||
| logoless bool | ||
| ) | ||
| flag.BoolVar(&debugParam, "debug", false, "enable debug") | ||
| flag.BoolVar(&plainFontsParam, "plain-fonts", false, "disable NerdFonts (if you see weird icons)") | ||
| flag.BoolVar(&logoless, "logoless", false, "start ktea without logo") | ||
|
||
| flag.Parse() | ||
|
|
||
| plainFontParamSet := false | ||
|
|
@@ -353,12 +358,15 @@ func main() { | |
| disableNerdFonts = &plainFontsParam | ||
| } | ||
|
|
||
| m := NewModel( | ||
| disableNerdFonts, | ||
| kadmin.SaramaInstantiator(), | ||
| config.NewDefaultIO(), | ||
| ) | ||
| m.logoless = logoless | ||
|
||
|
|
||
| p := tea.NewProgram( | ||
| NewModel( | ||
| disableNerdFonts, | ||
| kadmin.SaramaInstantiator(), | ||
| config.NewDefaultIO(), | ||
| ), | ||
| m, | ||
| tea.WithAltScreen(), | ||
| ) | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe call this hideLogo?