mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
Check for errors initializing client for autocomplete
This commit is contained in:
@@ -100,7 +100,11 @@ func (c *NodeStatusCommand) AutocompleteFlags() complete.Flags {
|
||||
|
||||
func (c *NodeStatusCommand) AutocompleteArgs() complete.Predictor {
|
||||
return complete.PredictFunc(func(a complete.Args) []string {
|
||||
client, _ := c.Meta.Client()
|
||||
client, err := c.Meta.Client()
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
resp, _, err := client.Search().PrefixSearch(a.Last, contexts.Nodes, nil)
|
||||
if err != nil {
|
||||
return []string{}
|
||||
|
||||
Reference in New Issue
Block a user