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

Fix validate cmd bug #5920

Merged
merged 4 commits into from
Apr 4, 2020
Merged

Fix validate cmd bug #5920

merged 4 commits into from
Apr 4, 2020

Conversation

colin-axner
Copy link
Contributor

@colin-axner colin-axner commented Apr 2, 2020

Closes: #5919

Description

updates validateCmd to search for the unknown command, ignoring any flags and their values and returning the help screen if the help flags are an argument.

untested at the moment.. having trouble installing via gaia because this branch is on the latest sdk version which has build issues on gaia


For contributor use:

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

For admin use:

  • Added appropriate labels to PR (ex. WIP, R4R, docs, etc)
  • Reviewers assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

client/cmd.go Outdated
for _, s := range suggestions {
err += fmt.Sprintf("\t%v\n", s)
// check if the current arg is a flag
if len(arg) > 0 && (arg[0] == '-') {
Copy link
Contributor

Choose a reason for hiding this comment

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

ifElseChain: rewrite if-else to switch statement (from gocritic)

@alexanderbez
Copy link
Contributor

@colin-axner I've updated Gaia to work with the latest master (e0c1774). Please go ahead and test these changes along with addressing any lint issues. Thanks for taking this up! 👍

@codecov
Copy link

codecov bot commented Apr 3, 2020

Codecov Report

Merging #5920 into master will increase coverage by 0.58%.
The diff coverage is 81.25%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5920      +/-   ##
==========================================
+ Coverage   56.48%   57.06%   +0.58%     
==========================================
  Files         342      342              
  Lines       20261    20064     -197     
==========================================
+ Hits        11444    11450       +6     
+ Misses       7972     7768     -204     
- Partials      845      846       +1
Impacted Files Coverage Δ
client/cmd.go 75% <81.25%> (ø) ⬆️
x/auth/client/tx.go 14.74% <0%> (ø) ⬆️
x/staking/client/cli/tx.go 11.83% <0%> (+5.39%) ⬆️

@alexanderbez
Copy link
Contributor

@colin-axner lmk when this is R4R again.

@colin-axner
Copy link
Contributor Author

@alexanderbez it's R4R, I tested locally with latest gaia version

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.

ACK 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

validateCmd interprets flag values as unknown commands
3 participants