-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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: CLI UX Updates #1 #1983
R4R: CLI UX Updates #1 #1983
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1983 +/- ##
========================================
Coverage 63.83% 63.83%
========================================
Files 113 113
Lines 6684 6684
========================================
Hits 4267 4267
Misses 2133 2133
Partials 284 284 |
Hey @mslipper ! Thanks for taking the time to make contributions :) thanks again! :) |
Could you please update the changelog? |
Waiting for after v0.24 |
@rigelrozanski sure thing! |
Pending log updated. |
PENDING.md
Outdated
@@ -38,6 +38,8 @@ BREAKING CHANGES | |||
* [types] sdk.NewCoin now takes sdk.Int, sdk.NewInt64Coin takes int64 | |||
* [cli] #1551: Officially removed `--name` from CLI commands | |||
* [cli] Genesis/key creation (`init`) now supports user-provided key passwords | |||
* [cli] --print-response now defaults to true in commands that create and send a transaction | |||
* [cli] you can now pass --public-key or --address to `gaiacli keys show` to return a plaintext representation of the key's address or public key for use with other commands |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think pubkey is generally accepted abbreviation, so maybe rename to --pubkey
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++
@mslipper may you also reference the PR here?
client/flags.go
Outdated
@@ -19,6 +19,8 @@ const ( | |||
FlagAsync = "async" | |||
FlagJson = "json" | |||
FlagPrintResponse = "print-response" | |||
FlagAddress = "address" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to move these two const into keys/show.go
file?
client/keys/show.go
Outdated
}, | ||
} | ||
|
||
func init() { | ||
showKeysCmd.Flags().Bool(client.FlagAddress, false, "output the address only (overrides --output)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not have a single --text-format
flag, which is set to NAME:\tTYPE:\tADDRESS:\t\t\t\t\t\tPUBKEY
by default? Then everybody can choose whatever text format they want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The objective of this output format is to allow piping to other commands, so we'd need to add additional options to not show that header.
client/tx/search.go
Outdated
|
||
For example: | ||
|
||
$ gaiacli advanced tendermint txs --tag test1,test2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note advanced
will soon be removed #2014
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++
client/keys/utils.go
Outdated
"github.com/tendermint/tendermint/libs/cli" | ||
dbm "github.com/tendermint/tendermint/libs/db" | ||
|
||
"github.com/cosmos/cosmos-sdk/client" | ||
|
||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove space
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contrib @mslipper ! I left a bit of feedback + also need to address broken CI 👍
client/tx/search.go
Outdated
|
||
For example: | ||
|
||
$ gaiacli advanced tendermint txs --tag test1,test2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++
client/keys/show.go
Outdated
|
||
const ( | ||
FlagAddress = "address" | ||
FlagPublicKey = "public-key" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pubkey
*
PENDING.md
Outdated
@@ -41,6 +41,8 @@ BREAKING CHANGES | |||
* [cli] Genesis/key creation (`init`) now supports user-provided key passwords | |||
* [cli] unsafe_reset_all, show_validator, and show_node_id have been renamed to unsafe-reset-all, show-validator, and show-node-id | |||
* [cli] \#1901 Flag --address-validator renamed to --validator in stake and slashing commands | |||
* [cli] --print-response now defaults to true in commands that create and send a transaction |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing PR reference ;-)
panic(err) | ||
} | ||
fmt.Println(ko.PubKey) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a newline for consistency 👍
0c410d7
to
7cb3f5b
Compare
77e505a
to
31df0ac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested ACK -- not too familiar with the CircleCI config/setup, so it might warrant another pair of eyes, but everything else looks fine. Thanks!
client/keys/show.go
Outdated
"github.com/gorilla/mux" | ||
|
||
"github.com/spf13/cobra" | ||
"github.com/spf13/viper" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gofmt? btw, our (a bit outdated) Go guidelines: https://github.com/tendermint/coding/blob/master/go/coding_standard.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our editors are set up so that we always fmt before saving.
Just a comment but otherwise LGTM |
…ptext updates Closes cosmos#1970 Closes cosmos#1971 Closes cosmos#1967 Closes cosmos#1969
I think this is ready to go! |
@@ -2,76 +2,57 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upgrade your version of dep
, then this shouldn't happen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
This PR closes #1970, #1971, #1967, and #1969.