Handle 0 args case
This commit is contained in:
@@ -7,6 +7,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func run(commands []command.Command, args []string) {
|
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] })
|
command, found := lo.Find(commands, func(c command.Command) bool { return c.GetName() == args[0] })
|
||||||
|
|
||||||
if !found {
|
if !found {
|
||||||
|
|||||||
Reference in New Issue
Block a user