remove indentation from json output of `show` and `providers schema` (#20623)

* command/providers schema: correct help text

* command/show: remove indentation from json output

* command/providers schema: remove indentation from json output
This commit is contained in:
Kristin Laemmert 2019-03-11 07:29:36 -07:00 committed by GitHub
parent dc154cf242
commit 30672faebe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 6 deletions

View File

@ -135,8 +135,7 @@ func Marshal(
return nil, fmt.Errorf("error marshaling config: %s", err)
}
// add some polish
ret, err := json.MarshalIndent(output, "", " ")
ret, err := json.Marshal(output)
return ret, err
}

View File

@ -42,8 +42,7 @@ func Marshal(s *terraform.Schemas) ([]byte, error) {
providers.Schemas[k] = marshalProvider(v)
}
// add some polish for the human consumers
ret, err := json.MarshalIndent(providers, "", " ")
ret, err := json.Marshal(providers)
return ret, err
}

View File

@ -135,7 +135,7 @@ func Marshal(sf *statefile.File, schemas *terraform.Schemas) ([]byte, error) {
return nil, err
}
ret, err := json.MarshalIndent(output, "", " ")
ret, err := json.Marshal(output)
return ret, err
}

View File

@ -45,6 +45,12 @@ func (c *ProvidersSchemaCommand) Run(args []string) int {
return 1
}
// Check for user-supplied plugin path
if c.pluginPath, err = c.loadPluginPath(); err != nil {
c.Ui.Error(fmt.Sprintf("Error loading plugin path: %s", err))
return 1
}
var diags tfdiags.Diagnostics
// Load the backend
@ -100,7 +106,7 @@ func (c *ProvidersSchemaCommand) Run(args []string) int {
}
const providersSchemaCommandHelp = `
Usage: terraform providers schemas -json
Usage: terraform providers schema -json
Prints out a json representation of the schemas for all providers used
in the current configuration.