Skip to content
Myr

command.go

This file

Path

join/command.go

34 lines · 1.2 KiB · Go

Last changed by

Not known.

History of this file

Take it

The walk stopped after 200 commits: lines older than 19a93b0 point at it.

refactor(input): simplify echoModeCarlos Alexandro Beckerbefore adoption19a93b0

lines 1–34why, one step back
1// Package join provides a shell script interface for the lipgloss
2// JoinHorizontal and JoinVertical commands. It allows you to join multi-line3// text to build different layouts.4//5// For example, you can place two bordered boxes next to each other: Note: We6// wrap the variable in quotes to ensure the new lines are part of a single7// argument. Otherwise, the command won't work as expected.8//9// $ gum join --horizontal "$BUBBLE_BOX" "$GUM_BOX"10//11// ╔══════════════════════╗╔═════════════╗12// ║ ║║ ║13// ║ Bubble ║║ Gum ║14// ║ ║║ ║15// ╚══════════════════════╝╚═════════════╝16package join1718import (19 "fmt"2021 "github.com/charmbracelet/lipgloss"2223 "github.com/charmbracelet/gum/internal/decode"24)2526// Run is the command-line interface for the joining strings through lipgloss.27func (o Options) Run() error {28 join := lipgloss.JoinHorizontal29 if o.Vertical {30 join = lipgloss.JoinVertical31 }32 fmt.Println(join(decode.Align[o.Align], o.Text...))33 return nil34}