1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-02 14:07:46 +00:00

uucore: Add globbing for Windows machines

This commit is contained in:
Roy Ivy III 2018-07-28 21:19:34 -05:00
parent c64bb05cbe
commit 0af7fbbf3b
4 changed files with 13 additions and 3 deletions

View file

@ -13,7 +13,7 @@ use uu_@UTIL_CRATE@::uumain;
fn main() { fn main() {
uucore::panic::install_sigpipe_hook(); uucore::panic::install_sigpipe_hook();
let code = uumain(std::env::args().collect()); let code = uumain(uucore::args().collect());
// Since stdout is line-buffered by default, we need to ensure any pending // Since stdout is line-buffered by default, we need to ensure any pending
// writes are flushed before exiting. Ideally, this should be enforced by // writes are flushed before exiting. Ideally, this should be enforced by
// each utility. // each utility.

View file

@ -10,6 +10,7 @@ failure_derive = { version = "0.1.1", optional = true }
time = { version = "0.1.40", optional = true } time = { version = "0.1.40", optional = true }
data-encoding = { version = "^2.1", optional = true } data-encoding = { version = "^2.1", optional = true }
libc = { version = "0.2.42", optional = true } libc = { version = "0.2.42", optional = true }
wild = "1.0.1"
[target.'cfg(target_os = "redox")'.dependencies] [target.'cfg(target_os = "redox")'.dependencies]
termion = "1.5" termion = "1.5"

View file

@ -1,3 +1,13 @@
extern crate wild;
pub fn args() -> Box<Iterator<Item=String>> {
Box::new( wild::args().map(|s| s.into_string().unwrap()) )
}
pub fn args_os() -> Box<Iterator<Item=std::ffi::OsString>> {
Box::new( wild::args() )
}
#[cfg(feature = "libc")] #[cfg(feature = "libc")]
pub extern crate libc; pub extern crate libc;
#[cfg(feature = "winapi")] #[cfg(feature = "winapi")]

View file

@ -13,7 +13,6 @@ include!(concat!(env!("OUT_DIR"), "/uutils_crates.rs"));
use std::collections::hash_map::HashMap; use std::collections::hash_map::HashMap;
use std::path::Path; use std::path::Path;
use std::env;
use std::io::Write; use std::io::Write;
extern crate uucore; extern crate uucore;
@ -40,7 +39,7 @@ fn main() {
uucore::panic::install_sigpipe_hook(); uucore::panic::install_sigpipe_hook();
let umap = util_map(); let umap = util_map();
let mut args: Vec<String> = env::args().collect(); let mut args: Vec<String> = uucore::args().collect();
// try binary name as util name. // try binary name as util name.
let args0 = args[0].clone(); let args0 = args[0].clone();