Handle 0 args case

This commit is contained in:
2024-07-18 10:24:13 +02:00
parent 1fe4fbd7d8
commit f3223a8a2f

View File

@@ -7,6 +7,11 @@ import (
)
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 {