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: Reorganize CLI command structure. #2728

Merged
merged 10 commits into from
Nov 13, 2018
Merged

Conversation

jackzampolin
Copy link
Member

@jackzampolin jackzampolin commented Nov 7, 2018

Fixes #2575

Only one cmd.AddCommand is called for each so command registration is more declarative. There are a number of docs fixes that will be entailed here, but we are currently refactoring all of that documentation.

cc @gamarin2 @zramsay @ValarDragon @alessio

@codecov
Copy link

codecov bot commented Nov 8, 2018

Codecov Report

Merging #2728 into develop will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff            @@
##           develop    #2728   +/-   ##
========================================
  Coverage    56.63%   56.63%           
========================================
  Files          156      156           
  Lines         9783     9783           
========================================
  Hits          5541     5541           
  Misses        3864     3864           
  Partials       378      378

Copy link
Contributor

@rigelrozanski rigelrozanski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice reorg!

var chainID string
chainID, err = types.DefaultChainID()
// var chainID string
chainID, err := types.DefaultChainID()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++

@@ -66,8 +68,7 @@ func runConfigCmd(cmd *cobra.Command, args []string) error {
Home: gaiaCLIHome,
ChainID: chainID,
TrustNode: trustNode,
Encoding: encoding,
Output: output,
Output: "text",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's please create and use a newCliConfig(...) function for here (avoid missing structs in the future)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole functionality is currently broken. I'll open an issue for that and fix it in another PR if thats OK.

Copy link
Contributor

@alessio alessio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed with @rigelrozanski's remark on newCliConfig. Other than that, the rest looks good to me. Thanks @jackzampolin

Copy link
Contributor

@cwgoes cwgoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit and agree with previous comment, but otherwise LGTM.

client/config.go Outdated
output := "text"
var chainID string
chainID, err = types.DefaultChainID()
// var chainID string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's delete this comment?

// Group staking queries under a subcommand
stakeQueryCmd := &cobra.Command{
Use: "stake",
Short: "Querying commands for staking module",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Short: "Querying commands for staking module",
Short: "Querying commands for the staking module",

// Group gov queries under a subcommand
govQueryCmd := &cobra.Command{
Use: "gov",
Short: "Querying commands for gov module",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Short: "Querying commands for gov module",
Short: "Querying commands for the governance module",

// Group slashing queries under a subcommand
slashingQueryCmd := &cobra.Command{
Use: "slashing",
Short: "Querying commands for slashing module",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Short: "Querying commands for slashing module",
Short: "Querying commands for the slashing module",


stakeTxCmd := &cobra.Command{
Use: "stake",
Short: "Stake Transactions subcommands",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Short: "Stake Transactions subcommands",
Short: "Staking transaction subcommands",


distTxCmd := &cobra.Command{
Use: "dist",
Short: "Distribution Transactions subcommands",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Short: "Distribution Transactions subcommands",
Short: "Distribution transaction subcommands",


govTxCmd := &cobra.Command{
Use: "gov",
Short: "Governance Transactions subcommands",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Short: "Governance Transactions subcommands",
Short: "Governance transaction subcommands",


slashingTxCmd := &cobra.Command{
Use: "slashing",
Short: "Slashing Transactions subcommands",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Short: "Slashing Transactions subcommands",
Short: "Slashing transaction subcommands",

@zramsay
Copy link
Contributor

zramsay commented Nov 8, 2018

awesome, much cleaner :) I've opened #2732 to track the docs update from this PR

Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK 🍍

@cwgoes
Copy link
Contributor

cwgoes commented Nov 12, 2018

Waiting on docs per @jackzampolin

jackzampolin added a commit that referenced this pull request Nov 12, 2018
@jackzampolin
Copy link
Member Author

Updated new docs to reflect changes here.

@alessio
Copy link
Contributor

alessio commented Nov 13, 2018

Tests keep failing

@alexanderbez
Copy link
Contributor

@jackzampolin do you need help with this one?

@jackzampolin
Copy link
Member Author

@alexanderbez Thanks for the offer, but I think I've got this fixed!

zramsay pushed a commit that referenced this pull request Nov 13, 2018
@jackzampolin jackzampolin merged commit 12ad39e into develop Nov 13, 2018
@jackzampolin jackzampolin deleted the jack/query-tx-reorg branch November 13, 2018 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move module query methods into a sub command
7 participants