Skip to content

Commit

Permalink
Remove unnecessary type of completePredictSequence
Browse files Browse the repository at this point in the history
  • Loading branch information
minamijoyo committed Jan 29, 2018
1 parent 2e82224 commit 2e8ec1a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 19 deletions.
11 changes: 0 additions & 11 deletions command/autocomplete.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,6 @@ import (
"github.com/posener/complete"
)

type completePredictSequence []complete.Predictor

func (s completePredictSequence) Predict(a complete.Args) []string {
idx := len(a.Completed)
if idx >= len(s) {
return nil
}

return s[idx].Predict(a)
}

func (m *Meta) completePredictResourceType() complete.Predictor {
return complete.PredictFunc(func(args complete.Args) []string {

Expand Down
5 changes: 1 addition & 4 deletions command/data_show.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ func (c *DataShowCommand) Run(args []string) int {
}

func (c *DataShowCommand) AutocompleteArgs() complete.Predictor {
return completePredictSequence{
complete.PredictNothing,
c.completePredictDataSource(),
}
return c.completePredictDataSource()
}

func (c *DataShowCommand) AutocompleteFlags() complete.Flags {
Expand Down
5 changes: 1 addition & 4 deletions command/resource_show.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ func (c *ResourceShowCommand) Run(args []string) int {
}

func (c *ResourceShowCommand) AutocompleteArgs() complete.Predictor {
return completePredictSequence{
complete.PredictNothing,
c.completePredictResourceType(),
}
return c.completePredictResourceType()
}

func (c *ResourceShowCommand) AutocompleteFlags() complete.Flags {
Expand Down

0 comments on commit 2e8ec1a

Please sign in to comment.