command: autocomplete data for "terraform init"
This commit is contained in:
parent
82fefbc599
commit
2ed9aa6077
|
@ -7,6 +7,8 @@ import (
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/posener/complete"
|
||||||
|
|
||||||
"github.com/hashicorp/go-getter"
|
"github.com/hashicorp/go-getter"
|
||||||
|
|
||||||
multierror "github.com/hashicorp/go-multierror"
|
multierror "github.com/hashicorp/go-multierror"
|
||||||
|
@ -452,6 +454,29 @@ func (c *InitCommand) getProviders(path string, state *terraform.State, upgrade
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *InitCommand) AutocompleteArgs() complete.Predictor {
|
||||||
|
return complete.PredictDirs("")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *InitCommand) AutocompleteFlags() complete.Flags {
|
||||||
|
return complete.Flags{
|
||||||
|
"-backend": completePredictBoolean,
|
||||||
|
"-backend-config": complete.PredictFiles("*.tfvars"), // can also be key=value, but we can't "predict" that
|
||||||
|
"-force-copy": complete.PredictNothing,
|
||||||
|
"-from-module": completePredictModuleSource,
|
||||||
|
"-get": completePredictBoolean,
|
||||||
|
"-get-plugins": completePredictBoolean,
|
||||||
|
"-input": completePredictBoolean,
|
||||||
|
"-lock": completePredictBoolean,
|
||||||
|
"-lock-timeout": complete.PredictAnything,
|
||||||
|
"-no-color": complete.PredictNothing,
|
||||||
|
"-plugin-dir": complete.PredictDirs(""),
|
||||||
|
"-reconfigure": complete.PredictNothing,
|
||||||
|
"-upgrade": completePredictBoolean,
|
||||||
|
"-verify-plugins": completePredictBoolean,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (c *InitCommand) Help() string {
|
func (c *InitCommand) Help() string {
|
||||||
helpText := `
|
helpText := `
|
||||||
Usage: terraform init [options] [DIR]
|
Usage: terraform init [options] [DIR]
|
||||||
|
|
Loading…
Reference in New Issue