don't print help for state loading errors

These already include detailed messages, and it's not a usage issue,
it's a config or file location issue.
This commit is contained in:
James Bardin 2017-07-27 14:10:52 -04:00
parent 2e7c8ab76a
commit 5b4ae36cb0
2 changed files with 3 additions and 3 deletions

View File

@ -40,7 +40,7 @@ func (c *StateMvCommand) Run(args []string) int {
stateFrom, err := c.State()
if err != nil {
c.Ui.Error(fmt.Sprintf(errStateLoadingState, err))
return cli.RunResultHelp
return 1
}
if err := stateFrom.RefreshState(); err != nil {
@ -64,7 +64,7 @@ func (c *StateMvCommand) Run(args []string) int {
stateTo, err = c.State()
if err != nil {
c.Ui.Error(fmt.Sprintf(errStateLoadingState, err))
return cli.RunResultHelp
return 1
}
if err := stateTo.RefreshState(); err != nil {

View File

@ -34,7 +34,7 @@ func (c *StateRmCommand) Run(args []string) int {
state, err := c.State()
if err != nil {
c.Ui.Error(fmt.Sprintf(errStateLoadingState, err))
return cli.RunResultHelp
return 1
}
if err := state.RefreshState(); err != nil {
c.Ui.Error(fmt.Sprintf("Failed to load state: %s", err))