-
Notifications
You must be signed in to change notification settings - Fork 10
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
Shell independent glob expansion #50
Comments
|
I was thinking shellexpand (for tilde expansion) Cli argument |
Uhh, my previous comment was a brain fart. I have a pull request in shellexpand fixing the deprecated use of |
How does shellexpand help with globbing? As a user I'd like to be able to type |
It doesn't help with globbing. It helps with expanding |
Isn't there also a problem with the |
No, I think that was because in previous version of The following code handles non-current directory globs just fine. use glob;
use std::error::Error;
use std::path::PathBuf;
fn main() -> Result<(), Box<Error>> {
let current_dir = PathBuf::from(".").canonicalize()?;
println!("current_dir: {:?}\n", current_dir);
let glob_for = "/home/alex/test_dir/**/*.png";
println!("results for glob: {}", glob_for);
let paths = glob::glob(glob_for)?;
for path in paths {
let result = path?;
println!("{:?}", result);
}
Ok(())
} Results
|
OK, cool. |
Removed |
From #49
Some shells may not have support for globstar
**
expansion.Bash has it disabled by default.
To support shells that don't have this feature a quoted string can be supplied (with a cli flag as well?).
riv --placeholder
**/*.png
The program will do shell expansion instead of the shell.
Also may be of use for extremely large amounts of images. As the length of the expanded arguments may be larger than the OS supports.
The text was updated successfully, but these errors were encountered: