Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.

Port find command #658

Merged
merged 11 commits into from Jan 23, 2022
Merged

Port find command #658

merged 11 commits into from Jan 23, 2022

Conversation

ghost
Copy link

@ghost ghost commented Jan 3, 2022

@fdncred
Copy link
Contributor

fdncred commented Jan 3, 2022

looking good so far. looks like it's going to be an upgrade to the nushell find command.

@ghost ghost marked this pull request as ready for review January 3, 2022 22:48
@ghost
Copy link
Author

ghost commented Jan 3, 2022

Thanks! What has been done with the PipelineIterator is great and helps a lot.

@ghost ghost marked this pull request as draft January 3, 2022 23:13
@fdncred
Copy link
Contributor

fdncred commented Jan 8, 2022

How's it going on this pr @arthur-targaryen? I remember having some discussion on this topic on discord.

@ghost
Copy link
Author

ghost commented Jan 8, 2022

How's it going on this pr @arthur-targaryen? I remember having some discussion on this topic on discord.

@fdncred I didn't find the time to work on ot this week but I've planned to finish it tomorrow 🙂

@fdncred
Copy link
Contributor

fdncred commented Jan 8, 2022

Sounds good. Thanks for the help and the update.

Comment on lines 145 to 146
Value::Binary { .. } => todo!(),
Value::CellPath { .. } => todo!(),
Copy link
Author

Choose a reason for hiding this comment

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

Not sure how those should be handled.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure. I'd have to look to see how nushell handles them. Was there anything useful there when you looked?

Copy link
Author

Choose a reason for hiding this comment

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

In nushell find converts each element of the input stream to a trimmed, lowercase string using convert_to_string().trim().to_lowercase(). Then it uses str::contains with the rest parameters of the command.

I tried to mimic this behavior for Value::CellPath in engine-q (see 45c006f).
However, the convert_to_string() method on Primivite::Binary in nushell always return an empty string, so we need to decide if we choose to change it, and if so how should it be changed.

Copy link
Contributor

Choose a reason for hiding this comment

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

@arthur-targaryen - I don't think we support it just yet, but if you want, I think it'd be fine to file an issue and go with the assumption that we'll add support in the future. It shouldn't directly impact the find work.

@sophiajt
Copy link
Contributor

@arthur-targaryen - is this ready? or are there things missing that need to be added before it's ready?

@ghost
Copy link
Author

ghost commented Jan 22, 2022

@arthur-targaryen - is this ready? or are there things missing that need to be added before it's ready?

Following you reply to my comment, I just want to replace the todo! with a proper error and it should be ready to merge!

@kubouch
Copy link
Contributor

kubouch commented Jan 22, 2022

@arthur-targaryen Awesome! Can you also clear out the merge conflicts?

@ghost ghost marked this pull request as ready for review January 23, 2022 21:09
@fdncred
Copy link
Contributor

fdncred commented Jan 23, 2022

@arthur-targaryen I'll land this if we're ready. Are we?

@ghost
Copy link
Author

ghost commented Jan 23, 2022

@arthur-targaryen I'll land this if we're ready. Are we?

Yep we are, finally 🙂

@fdncred fdncred merged commit f82e2fb into nushell:main Jan 23, 2022
@fdncred
Copy link
Contributor

fdncred commented Jan 23, 2022

Thanks for all your hard work on this!!!

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

Successfully merging this pull request may close these issues.

None yet

3 participants