Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R4R: make gaiacli config handle "indent" flag #3342

Merged
merged 2 commits into from
Jan 22, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions PENDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ FEATURES
* [\#3198](https://github.com/cosmos/cosmos-sdk/issues/3198) New `multisign` command to generate multisig signatures.
* [\#3198](https://github.com/cosmos/cosmos-sdk/issues/3198) New `sign --multisig` flag to enable multisig mode.
* [\#2715](https://github.com/cosmos/cosmos-sdk/issues/2715) Reintroduce gaia server's insecure mode.
* [\#2607](https://github.com/cosmos/cosmos-sdk/issues/2607) Make `gaiacli config` handle the boolean `indent` flag to beautify commands JSON output.

* Gaia
* [\#2182] [x/staking] Added querier for querying a single redelegation
Expand Down
4 changes: 2 additions & 2 deletions client/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func runConfigCmd(cmd *cobra.Command, args []string) error {
// Get value action
if getAction {
switch key {
case "trace", "trust-node":
case "trace", "trust-node", "indent":
fmt.Println(tree.GetDefault(key, false).(bool))
default:
if defaultValue, ok := configDefaults[key]; ok {
Expand All @@ -98,7 +98,7 @@ func runConfigCmd(cmd *cobra.Command, args []string) error {
switch key {
case "chain-id", "output", "node":
tree.Set(key, value)
case "trace", "trust-node":
case "trace", "trust-node", "indent":
boolVal, err := strconv.ParseBool(value)
if err != nil {
return err
Expand Down
2 changes: 2 additions & 0 deletions cmd/gaia/cli_test/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -880,10 +880,12 @@ func TestGaiaCLIConfig(t *testing.T) {
f.CLIConfig("trust-node", "true")
f.CLIConfig("chain-id", f.ChainID)
f.CLIConfig("trace", "false")
f.CLIConfig("indent", "true")

config, err := ioutil.ReadFile(path.Join(f.GCLIHome, "config", "config.toml"))
require.NoError(t, err)
expectedConfig := fmt.Sprintf(`chain-id = "%s"
indent = true
node = "%s"
output = "text"
trace = false
Expand Down