akash-network / support

Akash Support and Issue Tracking
Apache License 2.0
5 stars 4 forks source link

-o yaml outputs json #60

Open boz opened 3 years ago

boz commented 3 years ago
$ ./akash query account akash1gumjaae66pnk4jvea6v6k8s02w3au3986zkvke -o yaml
{"@type":"/cosmos.auth.v1beta1.BaseAccount","address":"akash1gumjaae66pnk4jvea6v6k8s02w3au3986zkvke","pub_key":null,"account_number":"6895","sequence":"0"}
$ ./akash query account akash1gumjaae66pnk4jvea6v6k8s02w3au3986zkvke -o json
{"@type":"/cosmos.auth.v1beta1.BaseAccount","address":"akash1gumjaae66pnk4jvea6v6k8s02w3au3986zkvke","pub_key":null,"account_number":"6895","sequence":"0"}
$ ./akash query account akash1gumjaae66pnk4jvea6v6k8s02w3au3986zkvke
'@type': /cosmos.auth.v1beta1.BaseAccount
account_number: "6895"
address: akash1gumjaae66pnk4jvea6v6k8s02w3au3986zkvke
pub_key: null
sequence: "0"
hydrogen18 commented 3 years ago

Weirdly, -o text writes YAML. Reviewing the cosmos SDK code this appears to be intentional

$ ../../akash --home=$PWD/cache query account akash1dc2wnk9alyxumdhsun8l0w8jlma253dhkfsk78 -o text
'@type': /cosmos.auth.v1beta1.BaseAccount
account_number: "0"
address: akash1dc2wnk9alyxumdhsun8l0w8jlma253dhkfsk78
pub_key: null
sequence: "0"

The documentation seems to indicate this

-o, --output string   Output format (text|json) (default "text"

I can propose this as a bug to the Cosmos SDK team, but I'm not sure if they consider it one.

troian commented 3 years ago

another issue -o does not work for some commands

boz commented 3 years ago

I think this might have been fixed. Verify?

troian commented 3 years ago

still an issue on v0.12.2-rc0 -o text outputs yaml. will have to contact cosmos team