Basic completion for options
This commit is contained in:
@@ -6,7 +6,6 @@ import "strings"
|
||||
|
||||
type Match struct {
|
||||
Word string `json:"word,omitempty"`
|
||||
FullForm string `json:"full_form,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
}
|
||||
|
||||
@@ -123,6 +122,10 @@ func (self *Command) has_subcommands() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (self *Command) add_option(opt *Option) {
|
||||
self.Options = append(self.Options, opt)
|
||||
}
|
||||
|
||||
func (self *Command) GetCompletions(argv []string) *Completions {
|
||||
ans := Completions{Groups: make([]*MatchGroup, 0, 4)}
|
||||
if len(argv) > 0 {
|
||||
|
||||
Reference in New Issue
Block a user