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/ls: use new cmds lib #5663

Closed
wants to merge 1 commit into from

Conversation

overbool
Copy link
Contributor

@overbool overbool commented Oct 26, 2018

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

@overbool overbool requested a review from Kubuxu as a code owner October 26, 2018 17:27
@overbool overbool force-pushed the refactor/commands/ls branch 2 times, most recently from 045efe0 to f7339eb Compare October 26, 2018 17:41
@Stebalien Stebalien mentioned this pull request Oct 26, 2018
73 tasks
License: MIT
Signed-off-by: Overbool <overbool.xu@gmail.com>
Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

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

Couple of small changes but otherwise LGTM.

However, I'd like to delay this until we make a decision on #5611. That PR includes this change (switches to the new commands lib) but also make some significantly more complicated changes that would be a pain to rebase on-top of this PR.

@@ -93,43 +81,39 @@ The JSON output contains type information.
dserv = merkledag.NewDAGService(bserv)
}

paths := req.Arguments()
paths := req.Arguments
Copy link
Member

Choose a reason for hiding this comment

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

There really isn't a need to set this anymore, we can just use it directly in the loop below.

for _, object := range output.Objects {
if len(output.Objects) > 1 {
fmt.Fprintf(w, "%s:\n", object.Hash)
tw := tabwriter.NewWriter(buf, 1, 2, 1, ' ', 0)
Copy link
Member

Choose a reason for hiding this comment

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

Let's pass w into tabwriter.NewWriter directly (and get rid of buf entirely). We used to put this all in a buffer because we had to return it from the command but that's no longer necessary.

@Stebalien Stebalien added the status/blocked Unable to be worked further until needs are met label Oct 26, 2018
@hannahhoward
Copy link
Contributor

@overbool and #5611 is dependent on ipfs/go-unixfs#39 -- which is almost merged, and then I'll move my focus to #5611

@kevina
Copy link
Contributor

kevina commented Nov 5, 2018

@Stebalien I would rather we not delay this as this the switch to the new commands lib is blocking any work on #5464 and #5611 may take a while to get in.

@Stebalien Stebalien added status/blocked Unable to be worked further until needs are met and removed status/blocked Unable to be worked further until needs are met labels Nov 5, 2018
@overbool overbool closed this Nov 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/blocked Unable to be worked further until needs are met
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants