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

commands/boostrap: use new cmds #5678

Merged
merged 2 commits into from
Nov 7, 2018

Conversation

overbool
Copy link
Contributor

Refer: #5664

License: MIT
Signed-off-by: Overbool overbool.xu@gmail.com

@overbool overbool requested a review from Kubuxu as a code owner October 27, 2018 06:27
Copy link
Member

@magik6k magik6k left a comment

Choose a reason for hiding this comment

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

}

r, err := fsrepo.Open(req.InvocContext().ConfigRoot)
ctx := env.(*oldcmds.Context)
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a requirement, but we should likely create another helper function in core/commands/cmdenv and call it GetConfigRoot. This way it makes it clear that the cast is the right thing to do. It would of saved me 10-15 minutes of review time.

Copy link
Contributor

@kevina kevina left a comment

Choose a reason for hiding this comment

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

Due to an Oddity with how parsing arguments from Stdin when ever you have a command that can accept more than one argument from Stdin you must either call req.ParseBodyArgs() before using req.Arguments or iterate over them with req.BodyArgs(), with the former being preferred for now. If you don't only the first argument will be read from Stdin.

You can test this my trying to pass two arguments via the command line to an affected command and then try again via Stdin.

License: MIT
Signed-off-by: Overbool <overbool.xu@gmail.com>
License: MIT
Signed-off-by: Overbool <overbool.xu@gmail.com>
@overbool overbool changed the title [WIP] commands/boostrap: use new cmds commands/boostrap: use new cmds Nov 7, 2018
@overbool
Copy link
Contributor Author

overbool commented Nov 7, 2018

@kevina I had fixed them, could u help me review it again?

@Stebalien Stebalien mentioned this pull request Nov 7, 2018
73 tasks
Copy link
Contributor

@kevina kevina left a comment

Choose a reason for hiding this comment

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

LGTM.

@Stebalien Stebalien merged commit 901e9fb into ipfs:master Nov 7, 2018
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.

4 participants