Wanting to gauge whether this would be an accepted feature! See #66 (comment), where I saw this mentioned before. I want to implement something like the ip address command, which can be called using ip address, ip addr, ip a, etc - all prefixes of address are allowed. Manually specifying all allowed values in kong is currently very verbose, and clutters up the help.
Here's a potential proposal to allow something like this - added as an extension to aliases so that each command would need to opt into this.
Essentially, something like:
type Cmd struct {
// aliases is extended to allow a range of valid aliases
// the <cert> portion indicates the minimum allowed value
// the <ificates> portion indicates optional characters
Certificates `cmd:"" aliases:"cert|ificates"`
}
Would allow all of:
$ cmd certificates
$ cmd certificate
$ cmd cert
$ cmd certif # weird but allowed
For showing aliases in the help, we can abbreviate this to cert[ificates].
Very very happy to submit a patch for this, but wanted to see if it's a good idea first.
Wanting to gauge whether this would be an accepted feature! See #66 (comment), where I saw this mentioned before. I want to implement something like the
ip address command, which can be called usingip address,ip addr,ip a, etc - all prefixes ofaddressare allowed. Manually specifying all allowed values in kong is currently very verbose, and clutters up the help.Here's a potential proposal to allow something like this - added as an extension to
aliasesso that each command would need to opt into this.Essentially, something like:
Would allow all of:
$ cmd certificates $ cmd certificate $ cmd cert $ cmd certif # weird but allowedFor showing aliases in the help, we can abbreviate this to
cert[ificates].Very very happy to submit a patch for this, but wanted to see if it's a good idea first.