feat: Embed() option and Context.Call()
The former allows arbitrary structs to be embedded in the root of the CLI, with optional tags. The latter allows an arbitrary function to be called using Kong's binding functionality.
This commit is contained in:
@@ -44,6 +44,16 @@ type Tag struct {
|
||||
items map[string][]string
|
||||
}
|
||||
|
||||
func (t *Tag) String() string {
|
||||
out := []string{}
|
||||
for key, list := range t.items {
|
||||
for _, value := range list {
|
||||
out = append(out, fmt.Sprintf("%s:%q", key, value))
|
||||
}
|
||||
}
|
||||
return strings.Join(out, " ")
|
||||
}
|
||||
|
||||
type tagChars struct {
|
||||
sep, quote, assign rune
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user