feat: allow non-structs to be used as commands (#428)
* feat: allow non-structs to be used as commands This small MR allows using the func-to-interface trick to implement a command (see commandFunc in kong_test.go). This is useful e.g. for commands that have no flags or arguments of their own, but instead receive all required information via bound parameters. * fix: check DynamicCommand is runnable when adding
This commit is contained in:
+1
-1
@@ -903,7 +903,7 @@ func checkMissingChildren(node *Node) error {
|
||||
if len(missing) == 1 {
|
||||
return fmt.Errorf("expected %s", missing[0])
|
||||
}
|
||||
return fmt.Errorf("expected one of %s", strings.Join(missing, ", "))
|
||||
return fmt.Errorf("expected one of %s", strings.Join(missing, ", "))
|
||||
}
|
||||
|
||||
// If we're missing any positionals and they're required, return an error.
|
||||
|
||||
Reference in New Issue
Block a user