hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/internal/cli/commands.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/cli/commands.go')
-rw-r--r--internal/cli/commands.go26
1 files changed, 3 insertions, 23 deletions
diff --git a/internal/cli/commands.go b/internal/cli/commands.go
index f50036c..d76402d 100644
--- a/internal/cli/commands.go
+++ b/internal/cli/commands.go
@@ -1,7 +1,6 @@
package cli
import (
- "fmt"
"strings"
tea "github.com/charmbracelet/bubbletea"
@@ -13,11 +12,9 @@ import (
func defaultCommands() []command {
return []command{
{
- name: "list-mods",
- desc: "List the configured mods",
- run: func(m *model) tea.Cmd {
- return tea.Println(renderModList(m.cfg))
- },
+ name: "mods",
+ desc: "Manage mods — list, search, add, pin versions, remove",
+ run: runMods,
},
{
name: "check",
@@ -76,23 +73,6 @@ func helpBlock(cmds []command) string {
return lipgloss.JoinVertical(lipgloss.Left, rows...)
}
-func renderModList(cfg *config.Config) string {
- rows := []string{
- headingStyle.Render(fmt.Sprintf("Mods for MC %s", cfg.MinecraftVersion)),
- "",
- }
-
- if len(cfg.ModrinthMods) == 0 {
- rows = append(rows, mutedStyle.Render(" (none configured)"))
- }
- for _, slug := range cfg.ModrinthMods {
- rows = append(rows, " "+bulletStyle.Render("◆ ")+slug)
- }
-
- rows = append(rows, "", mutedStyle.Render(fmt.Sprintf("Total: %d mods", len(cfg.ModrinthMods))))
- return lipgloss.JoinVertical(lipgloss.Left, rows...)
-}
-
func padRight(s string, n int) string {
if pad := n - len([]rune(s)); pad > 0 {
return s + strings.Repeat(" ", pad)