command: update help text

This commit is contained in:
Mitchell Hashimoto 2015-02-23 10:58:39 -08:00
parent 0299e60e83
commit a655c1619a
3 changed files with 15 additions and 33 deletions

View File

@ -143,20 +143,11 @@ Usage: terraform init [options] SOURCE [PATH]
Options:
-address=url URL of the remote storage server.
Required for HTTP backend, optional for Atlas and Consul.
-backend=atlas Specifies the type of remote backend. If not
specified, local storage will be used.
-access-token=token Authentication token for state storage server.
Required for Atlas backend, optional for Consul.
-backend=atlas Specifies the type of remote backend. Must be one
of Atlas, Consul, or HTTP. Defaults to atlas.
-name=name Name of the state file in the state storage server.
Required for Atlas backend.
-path=path Path of the remote state in Consul. Required for the
Consul backend.
-backend-config="k=v" Specifies configuration for the remote storage
backend. This can be specified multiple times.
`
return strings.TrimSpace(helpText)

View File

@ -38,7 +38,7 @@ func (c *RemoteCommand) Run(args []string) int {
cmdFlags.StringVar(&c.conf.statePath, "state", DefaultStateFilename, "path")
cmdFlags.StringVar(&c.conf.backupPath, "backup", "", "path")
cmdFlags.StringVar(&c.remoteConf.Type, "backend", "atlas", "")
cmdFlags.Var((*FlagKV)(&config), "config", "config")
cmdFlags.Var((*FlagKV)(&config), "backend-config", "config")
cmdFlags.Usage = func() { c.Ui.Error(c.Help()) }
if err := cmdFlags.Parse(args); err != nil {
return 1
@ -310,15 +310,12 @@ Usage: terraform remote [options]
Options:
-address=url URL of the remote storage server.
Required for HTTP backend, optional for Atlas and Consul.
-access-token=token Authentication token for state storage server.
Required for Atlas backend, optional for Consul.
-backend=Atlas Specifies the type of remote backend. Must be one
of Atlas, Consul, or HTTP. Defaults to Atlas.
-backend-config="k=v" Specifies configuration for the remote storage
backend. This can be specified multiple times.
-backup=path Path to backup the existing state file before
modifying. Defaults to the "-state" path with
".backup" extension. Set to "-" to disable backup.
@ -326,15 +323,9 @@ Options:
-disable Disables remote state management and migrates the state
to the -state path.
-name=name Name of the state file in the state storage server.
Required for Atlas backend.
-path=path Path of the remote state in Consul. Required for the
Consul backend.
-pull=true Controls if the remote state is pulled before disabling.
This defaults to true to ensure the latest state is cached
before disabling.
before disabling.
-state=path Path to read state. Defaults to "terraform.tfstate"
unless remote state is enabled.

View File

@ -243,8 +243,8 @@ func TestRemote_initBlank(t *testing.T) {
args := []string{
"-backend=http",
"-config", "address=http://example.com",
"-config", "access_token=test",
"-backend-config", "address=http://example.com",
"-backend-config", "access_token=test",
}
if code := c.Run(args); code != 0 {
t.Fatalf("bad: \n%s", ui.ErrorWriter.String())
@ -319,8 +319,8 @@ func TestRemote_updateRemote(t *testing.T) {
args := []string{
"-backend=http",
"-config", "address=http://example.com",
"-config", "access_token=test",
"-backend-config", "address=http://example.com",
"-backend-config", "access_token=test",
}
if code := c.Run(args); code != 0 {
t.Fatalf("bad: \n%s", ui.ErrorWriter.String())
@ -374,8 +374,8 @@ func TestRemote_enableRemote(t *testing.T) {
args := []string{
"-backend=http",
"-config", "address=http://example.com",
"-config", "access_token=test",
"-backend-config", "address=http://example.com",
"-backend-config", "access_token=test",
}
if code := c.Run(args); code != 0 {
t.Fatalf("bad: \n%s", ui.ErrorWriter.String())