mirror of
https://github.com/charmbracelet/gum
synced 2024-06-15 20:15:08 +02: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.
15 lines
287 B
Go
15 lines
287 B
Go
package style
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
)
|
|
|
|
// Run provides a shell script interface for the Lip Gloss styling.
|
|
// https://github.com/charmbracelet/lipgloss
|
|
func (o Options) Run() error {
|
|
text := strings.Join(o.Text, "\n")
|
|
fmt.Println(o.Style.ToLipgloss().Render(text))
|
|
return nil
|
|
}
|