chore: move everything out from src

This commit is contained in:
2025-03-03 06:52:47 +01:00
parent 469e737bb3
commit 23d1aaad55
19 changed files with 1 additions and 0 deletions

28
app.go Normal file
View File

@@ -0,0 +1,28 @@
package main
import (
"alma/command"
"github.com/samber/lo"
)
func run(commands []command.Command, args []string) {
if len(args) == 0 {
println("Usage: alma <command> [args]")
return
}
command, found := lo.Find(commands, func(c command.Command) bool { return c.GetName() == args[0] })
if !found {
println("Command not found")
return
}
commandArgs := args[1:]
if lo.ContainsBy(commandArgs, func(item string) bool { return (item == "-h" || item == "--help") }) {
command.GetHelpText()
return
}
command.Run(commandArgs)
}