git-bug/termui/help_bar.go
2020-08-22 15:12:09 +02:00

25 lines
398 B
Go

package termui
import (
"fmt"
"strings"
"github.com/MichaelMure/git-bug/util/colors"
)
type helpBar []struct {
keys string
text string
}
func (hb helpBar) Render() string {
var builder strings.Builder
for i, entry := range hb {
if i != 0 {
builder.WriteByte(' ')
}
builder.WriteString(colors.BlueBg(fmt.Sprintf("[%s] %s", entry.keys, entry.text)))
}
return builder.String()
}