diff --git a/command/agent/command.go b/command/agent/command.go index df47de38c..4e1c9e760 100644 --- a/command/agent/command.go +++ b/command/agent/command.go @@ -27,6 +27,7 @@ import ( "github.com/hashicorp/nomad/nomad/structs/config" "github.com/hashicorp/scada-client/scada" "github.com/mitchellh/cli" + "github.com/posener/complete" ) // gracefulTimeout controls how long we wait before forcefully terminating @@ -408,6 +409,20 @@ func (c *Command) checkpointResults(results *checkpoint.CheckResponse, err error } } +func (c *Command) AutocompleteFlags() complete.Flags { + configFilePredictor := complete.PredictOr( + complete.PredictFiles("*.json"), + complete.PredictFiles("*.hcl")) + + return map[string]complete.Predictor{ + "-config": configFilePredictor, + } +} + +func (c *Command) AutocompleteArgs() complete.Predictor { + return nil +} + func (c *Command) Run(args []string) int { c.Ui = &cli.PrefixedUi{ OutputPrefix: "==> ",