mirror of
https://github.com/nestriness/cli.git
synced 2025-12-13 04:35:37 +02:00
feat: Add padding
This commit is contained in:
14
cmd/root.go
14
cmd/root.go
@@ -10,6 +10,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/charmbracelet/lipgloss"
|
"github.com/charmbracelet/lipgloss"
|
||||||
|
"github.com/charmbracelet/lipgloss/table"
|
||||||
"github.com/muesli/termenv"
|
"github.com/muesli/termenv"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
@@ -34,6 +35,12 @@ var neoFetchCmd = &cobra.Command{
|
|||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
lipgloss.SetColorProfile(termenv.TrueColor)
|
lipgloss.SetColorProfile(termenv.TrueColor)
|
||||||
|
|
||||||
|
baseStyle := lipgloss.NewStyle().
|
||||||
|
PaddingTop(1).
|
||||||
|
PaddingRight(4).
|
||||||
|
PaddingBottom(1).
|
||||||
|
PaddingLeft(4)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
b strings.Builder
|
b strings.Builder
|
||||||
lines = strings.Split(art, "\n")
|
lines = strings.Split(art, "\n")
|
||||||
@@ -47,7 +54,12 @@ var neoFetchCmd = &cobra.Command{
|
|||||||
b.WriteRune('\n')
|
b.WriteRune('\n')
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Print(b.String())
|
t := table.New().
|
||||||
|
Border(lipgloss.HiddenBorder())
|
||||||
|
|
||||||
|
t.Row(baseStyle.Render(b.String()), baseStyle.Render("System Info goes here"))
|
||||||
|
|
||||||
|
fmt.Print(t)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user