mirror of
https://github.com/charmbracelet/gum.git
synced 2024-11-04 20:44:12 +03:00
7190822247
Instead of needing to run the commands manually in main.go, we can implement the `Run(...) error` method to satisfy the command interface so that `kong` can Run our commands for us.
25 lines
481 B
Go
25 lines
481 B
Go
package main
|
|
|
|
import (
|
|
"github.com/alecthomas/kong"
|
|
"github.com/charmbracelet/lipgloss"
|
|
"github.com/muesli/termenv"
|
|
)
|
|
|
|
func main() {
|
|
lipgloss.SetColorProfile(termenv.ANSI256)
|
|
gum := &Gum{}
|
|
ctx := kong.Parse(
|
|
gum,
|
|
kong.Name("gum"),
|
|
kong.Description("Tasty Bubble Gum for your shell."),
|
|
kong.UsageOnError(),
|
|
kong.ConfigureHelp(kong.HelpOptions{
|
|
Compact: true,
|
|
Summary: false,
|
|
}),
|
|
kong.Vars{"defaultBackground": "", "defaultForeground": ""},
|
|
)
|
|
ctx.Run()
|
|
}
|