gum/join/command.go
Maas Lalani 7190822247
refactor(kong): Implement Run(...) error interface
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.
2022-07-12 22:33:52 -04:00

19 lines
380 B
Go

package join
import (
"fmt"
"github.com/charmbracelet/gum/internal/decode"
"github.com/charmbracelet/lipgloss"
)
// Run is the command-line interface for the joining strings through lipgloss.
func (o Options) Run() error {
join := lipgloss.JoinHorizontal
if o.Vertical {
join = lipgloss.JoinVertical
}
fmt.Println(join(decode.Align[o.Align], o.Text...))
return nil
}