-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Rarely do I want a simple <command> <opaque parameter string> structure. I'd like to register commands with some kind of argument spec, which could be validated and propagated to my handler function.
Concrete use case: register all of the following commands:
- foo —plain command as it exists now; trailing arguments passed as opaque string to handler
- bar <string> [string] —one string argument is required, everything after that is passed as an opaque string to my handler, which is (ideally)
func doBar(string, string)but could befunc doBar([]interface{})orfunc doBar(interface{}...) - baz {alpha,beta,delta} <integer> [string] —
{alpha,beta,delta}being valid string tokens for that required argument (with tab-completion, natch),<integer>being a required argument that must successfully strconv.ParseInt, and[string]being an optional opaque string argument.
Metadata
Metadata
Assignees
Labels
No labels