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

add shellexpand and glob #1

Closed
vitiral opened this issue Jan 29, 2018 · 8 comments
Closed

add shellexpand and glob #1

vitiral opened this issue Jan 29, 2018 · 8 comments

Comments

@vitiral
Copy link
Collaborator

vitiral commented Jan 29, 2018

Glob

Add functions glob and glob_with which are identical to the ones in the glob crate except they return an iterator of PathType objects instead of simple paths.

This should really have rust-lang/glob#64 implemented so that GlobError is coercible into io::Error. GlobError already provides excellent context.

Shellexpand

This will mainly involve exporting the shellexpand module, but the trait mentioned in netvl/shellexpand#2 would probably improve the ergonomics.

I have read through the shellexpand source code and I think it has ergonomic error messages.

@vitiral
Copy link
Collaborator Author

vitiral commented Jan 29, 2018

@killercup thoughts?

@killercup
Copy link
Contributor

killercup commented Jan 29, 2018 via email

@vitiral
Copy link
Collaborator Author

vitiral commented Jan 29, 2018 via email

@killercup
Copy link
Contributor

@Gilnaa is already working on it.

Not sure if I want to include (parts of) it in quicli or I use a subset of its re-exports and add documentation about where to find more.

@vitiral
Copy link
Collaborator Author

vitiral commented Jan 29, 2018 via email

@vitiral
Copy link
Collaborator Author

vitiral commented Jan 29, 2018

Ok, I think that was the wrong approach.

Instead on my GlobPaths object I'm going to have a files() method that only returns files. I think that is the right approach.

This could honestly be added to the glob crate as well. I think I'm going to add a PR.

Update: see issue rust-lang/glob#65

@vitiral
Copy link
Collaborator Author

vitiral commented Jan 29, 2018

done

@vitiral vitiral closed this as completed Jan 29, 2018
@vitiral
Copy link
Collaborator Author

vitiral commented Jan 29, 2018

@killercup I recommend not exporting ergo_fs wholesale yet, as I think I'm going to remove the std_prelude export and replace it with only Path, PathBuf, Read and Write.

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

No branches or pull requests

2 participants