Add autocomplete where missing

This commit is contained in:
Chelsea Holland Komlo 2018-05-11 15:19:16 -04:00
parent 687c26093c
commit f0a5018a91
5 changed files with 35 additions and 1 deletions

View File

@ -4,6 +4,8 @@ import (
"fmt"
"sort"
"strings"
"github.com/posener/complete"
)
type AgentInfoCommand struct {
@ -26,6 +28,14 @@ func (c *AgentInfoCommand) Synopsis() string {
return "Display status information about the local agent"
}
func (c *AgentInfoCommand) AutocompleteFlags() complete.Flags {
return c.Meta.AutocompleteFlags(FlagSetClient)
}
func (c *AgentInfoCommand) AutocompleteArgs() complete.Predictor {
return complete.PredictNothing
}
func (c *AgentInfoCommand) Name() string { return "agent-info" }
func (c *AgentInfoCommand) Run(args []string) int {

View File

@ -54,7 +54,7 @@ func (c *JobHistoryCommand) Synopsis() string {
return "Display all tracked versions of a job"
}
func (c *JobHistoryCommand) Autocompleteflags() complete.Flags {
func (c *JobHistoryCommand) AutocompleteFlags() complete.Flags {
return mergeAutocompleteFlags(c.Meta.AutocompleteFlags(FlagSetClient),
complete.Flags{
"-p": complete.PredictNothing,

View File

@ -48,6 +48,10 @@ func (c *JobInitCommand) AutocompleteFlags() complete.Flags {
})
}
func (c *JobInitCommand) AutocompleteArgs() complete.Predictor {
return complete.PredictNothing
}
func (c *JobInitCommand) Name() string { return "job init" }
func (c *JobInitCommand) Run(args []string) int {

View File

@ -3,6 +3,8 @@ package command
import (
"fmt"
"strings"
"github.com/posener/complete"
)
type ServerForceLeaveCommand struct {
@ -28,6 +30,14 @@ func (c *ServerForceLeaveCommand) Synopsis() string {
return "Force a server into the 'left' state"
}
func (c *ServerForceLeaveCommand) AutocompleteFlags() complete.Flags {
return c.Meta.AutocompleteFlags(FlagSetClient)
}
func (c *ServerForceLeaveCommand) AutocompleteArgs() complete.Predictor {
return complete.PredictNothing
}
func (c *ServerForceLeaveCommand) Name() string { return "server force-leave" }
func (c *ServerForceLeaveCommand) Run(args []string) int {

View File

@ -3,6 +3,8 @@ package command
import (
"fmt"
"strings"
"github.com/posener/complete"
)
type ServerJoinCommand struct {
@ -29,6 +31,14 @@ func (c *ServerJoinCommand) Synopsis() string {
return "Join server nodes together"
}
func (c *ServerJoinCommand) AutocompleteFlags() complete.Flags {
return c.Meta.AutocompleteFlags(FlagSetClient)
}
func (c *ServerJoinCommand) AutocompleteArgs() complete.Predictor {
return complete.PredictNothing
}
func (c *ServerJoinCommand) Name() string { return "server join" }
func (c *ServerJoinCommand) Run(args []string) int {