mirror of
https://github.com/charmbracelet/gum.git
synced 2024-09-11 06:16:03 +03:00
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()
|
|
}
|