1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 19:17:43 +00:00

Merge pull request #718 from jbcrail/uucore

Split utility files into separate library.
This commit is contained in:
Heather 2015-11-24 20:46:26 -08:00
commit 2c1c5606f9
153 changed files with 353 additions and 399 deletions

3
.gitignore vendored
View file

@ -1,5 +1,6 @@
target/
/src/*/gen_table /src/*/gen_table
/target/ /build/
/tmp/ /tmp/
/busybox/ /busybox/
*~ *~

View file

@ -85,6 +85,7 @@ all = [
] ]
[dependencies] [dependencies]
uucore = { path="src/uucore" }
base64 = { optional=true, path="src/base64" } base64 = { optional=true, path="src/base64" }
basename = { optional=true, path="src/basename" } basename = { optional=true, path="src/basename" }
cat = { optional=true, path="src/cat" } cat = { optional=true, path="src/cat" }

View file

@ -11,6 +11,7 @@ path = "base64.rs"
getopts = "*" getopts = "*"
libc = "*" libc = "*"
rustc-serialize = "*" rustc-serialize = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="base64" name="base64"

View file

@ -13,6 +13,9 @@ extern crate rustc_serialize as serialize;
extern crate getopts; extern crate getopts;
extern crate libc; extern crate libc;
#[macro_use]
extern crate uucore;
use getopts::Options; use getopts::Options;
use serialize::base64::{self, FromBase64, ToBase64}; use serialize::base64::{self, FromBase64, ToBase64};
use std::ascii::AsciiExt; use std::ascii::AsciiExt;
@ -21,10 +24,6 @@ use std::fs::File;
use std::io::{BufReader, Read, stdin, stdout, Write}; use std::io::{BufReader, Read, stdin, stdout, Write};
use std::path::Path; use std::path::Path;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
enum Mode { enum Mode {
Decode, Decode,
Encode, Encode,

View file

@ -10,6 +10,7 @@ path = "basename.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="basename" name="basename"

View file

@ -12,14 +12,13 @@
extern crate getopts; extern crate getopts;
extern crate libc; extern crate libc;
#[macro_use]
extern crate uucore;
use getopts::Options; use getopts::Options;
use std::io::Write; use std::io::Write;
use std::path::{is_separator, PathBuf}; use std::path::{is_separator, PathBuf};
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "basename"; static NAME: &'static str = "basename";
static VERSION: &'static str = "1.0.0"; static VERSION: &'static str = "1.0.0";

View file

@ -10,6 +10,7 @@ path = "cat.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="cat" name="cat"

View file

@ -14,16 +14,15 @@
extern crate getopts; extern crate getopts;
extern crate libc; extern crate libc;
#[macro_use]
extern crate uucore;
use libc::STDIN_FILENO;
use libc::{c_int, isatty};
use getopts::Options; use getopts::Options;
use std::fs::File; use std::fs::File;
use std::intrinsics::{copy_nonoverlapping}; use std::intrinsics::{copy_nonoverlapping};
use std::io::{stdout, stdin, stderr, Write, Read, Result}; use std::io::{stdout, stdin, stderr, Write, Read, Result};
use libc::STDIN_FILENO;
use libc::{c_int, isatty};
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "cat"; static NAME: &'static str = "cat";
static VERSION: &'static str = "1.0.0"; static VERSION: &'static str = "1.0.0";

View file

@ -14,6 +14,7 @@ aho-corasick = "*"
memchr = "*" memchr = "*"
regex = "*" regex = "*"
regex-syntax = "*" regex-syntax = "*"
uucore = { path="../uucore" }
walker = "*" walker = "*"
[[bin]] [[bin]]

View file

@ -19,23 +19,18 @@ extern crate regex;
extern crate regex_syntax; extern crate regex_syntax;
extern crate walker; extern crate walker;
#[macro_use]
extern crate uucore;
use getopts::Options; use getopts::Options;
use regex::Regex; use regex::Regex;
use std::ffi::CString; use std::ffi::CString;
use std::io::{Error, Write}; use std::io::{Error, Write};
use std::mem; use std::mem;
use std::path::Path; use std::path::Path;
use uucore::fs::UUPathExt;
use walker::Walker; use walker::Walker;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
#[path = "../common/filesystem.rs"]
mod filesystem;
use filesystem::UUPathExt;
const NAME: &'static str = "chmod"; const NAME: &'static str = "chmod";
const VERSION: &'static str = "1.0.0"; const VERSION: &'static str = "1.0.0";

View file

@ -10,6 +10,7 @@ path = "chroot.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="chroot" name="chroot"

View file

@ -12,7 +12,9 @@
extern crate getopts; extern crate getopts;
extern crate libc; extern crate libc;
use c_types::{get_pw_from_args, get_group}; #[macro_use]
extern crate uucore;
use getopts::Options; use getopts::Options;
use libc::{setgid, setuid}; use libc::{setgid, setuid};
use std::ffi::CString; use std::ffi::CString;
@ -20,12 +22,8 @@ use std::io::{Error, Write};
use std::iter::FromIterator; use std::iter::FromIterator;
use std::path::Path; use std::path::Path;
use std::process::Command; use std::process::Command;
use uucore::c_types::{get_pw_from_args, get_group};
#[path = "../common/util.rs"] #[macro_use] mod util; use uucore::fs::UUPathExt;
#[path = "../common/c_types.rs"] mod c_types;
#[path = "../common/filesystem.rs"] mod filesystem;
use filesystem::UUPathExt;
extern { extern {
fn chroot(path: *const libc::c_char) -> libc::c_int; fn chroot(path: *const libc::c_char) -> libc::c_int;

View file

@ -10,6 +10,7 @@ path = "cksum.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="cksum" name="cksum"

View file

@ -11,6 +11,9 @@
extern crate getopts; extern crate getopts;
#[macro_use]
extern crate uucore;
use getopts::Options; use getopts::Options;
use std::fs::File; use std::fs::File;
use std::io::{self, stdin, Read, Write, BufReader}; use std::io::{self, stdin, Read, Write, BufReader};
@ -19,10 +22,6 @@ use std::path::Path;
use crc_table::CRC_TABLE; use crc_table::CRC_TABLE;
#[path="../common/util.rs"]
#[macro_use]
mod util;
mod crc_table; mod crc_table;
static NAME: &'static str = "cksum"; static NAME: &'static str = "cksum";

View file

@ -10,6 +10,7 @@ path = "cp.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="cp" name="cp"

View file

@ -11,19 +11,14 @@
extern crate getopts; extern crate getopts;
#[macro_use]
extern crate uucore;
use getopts::Options; use getopts::Options;
use std::fs; use std::fs;
use std::io::{ErrorKind, Result, Write}; use std::io::{ErrorKind, Result, Write};
use std::path::Path; use std::path::Path;
use uucore::fs::{canonicalize, CanonicalizeMode, UUPathExt};
#[path = "../common/util.rs"]
#[macro_use]
mod util;
#[path = "../common/filesystem.rs"]
mod filesystem;
use filesystem::{canonicalize, CanonicalizeMode, UUPathExt};
#[derive(Clone, Eq, PartialEq)] #[derive(Clone, Eq, PartialEq)]
pub enum Mode { pub enum Mode {

View file

@ -10,6 +10,7 @@ path = "cut.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="cut" name="cut"

View file

@ -12,22 +12,17 @@
extern crate getopts; extern crate getopts;
extern crate libc; extern crate libc;
#[macro_use]
extern crate uucore;
use std::fs::File; use std::fs::File;
use std::io::{stdout, stdin, BufRead, BufReader, Read, Stdout, Write}; use std::io::{stdout, stdin, BufRead, BufReader, Read, Stdout, Write};
use std::path::Path; use std::path::Path;
use uucore::fs::UUPathExt;
use ranges::Range; use ranges::Range;
use searcher::Searcher; use searcher::Searcher;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
#[path = "../common/filesystem.rs"]
mod filesystem;
use filesystem::UUPathExt;
mod buffer; mod buffer;
mod ranges; mod ranges;
mod searcher; mod searcher;

View file

@ -11,6 +11,7 @@ path = "du.rs"
getopts = "*" getopts = "*"
libc = "*" libc = "*"
time = "*" time = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="du" name="du"

View file

@ -15,6 +15,9 @@ extern crate getopts;
extern crate libc; extern crate libc;
extern crate time; extern crate time;
#[macro_use]
extern crate uucore;
use std::fs; use std::fs;
use std::io::{stderr, Write}; use std::io::{stderr, Write};
use std::os::unix::fs::MetadataExt; use std::os::unix::fs::MetadataExt;
@ -24,10 +27,6 @@ use time::Timespec;
use std::sync::mpsc::channel; use std::sync::mpsc::channel;
use std::thread; use std::thread;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "du"; static NAME: &'static str = "du";
static VERSION: &'static str = "1.0.0"; static VERSION: &'static str = "1.0.0";

View file

@ -10,6 +10,7 @@ path = "echo.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="echo" name="echo"

View file

@ -12,13 +12,12 @@
extern crate getopts; extern crate getopts;
extern crate libc; extern crate libc;
#[macro_use]
extern crate uucore;
use std::io::Write; use std::io::Write;
use std::str::from_utf8; use std::str::from_utf8;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
#[allow(dead_code)] #[allow(dead_code)]
static NAME: &'static str = "echo"; static NAME: &'static str = "echo";
static VERSION: &'static str = "1.0.0"; static VERSION: &'static str = "1.0.0";

1
src/env/Cargo.toml vendored
View file

@ -10,6 +10,7 @@ path = "env.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="env" name="env"

7
src/env/env.rs vendored
View file

@ -13,14 +13,13 @@
#![allow(non_camel_case_types)] #![allow(non_camel_case_types)]
#[macro_use]
extern crate uucore;
use std::env; use std::env;
use std::io::Write; use std::io::Write;
use std::process::Command; use std::process::Command;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "env"; static NAME: &'static str = "env";
static VERSION: &'static str = "1.0.0"; static VERSION: &'static str = "1.0.0";

View file

@ -11,6 +11,7 @@ path = "expand.rs"
getopts = "*" getopts = "*"
libc = "*" libc = "*"
unicode-width = "*" unicode-width = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="expand" name="expand"

View file

@ -17,6 +17,9 @@ extern crate libc;
extern crate rustc_unicode; extern crate rustc_unicode;
extern crate unicode_width; extern crate unicode_width;
#[macro_use]
extern crate uucore;
use std::fs::File; use std::fs::File;
use std::io::{stdin, stdout, BufRead, BufReader, BufWriter, Read, Write}; use std::io::{stdin, stdout, BufRead, BufReader, BufWriter, Read, Write};
use std::iter::repeat; use std::iter::repeat;
@ -24,10 +27,6 @@ use std::str::from_utf8;
use rustc_unicode::str::utf8_char_width; use rustc_unicode::str::utf8_char_width;
use unicode_width::UnicodeWidthChar; use unicode_width::UnicodeWidthChar;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "expand"; static NAME: &'static str = "expand";
static VERSION: &'static str = "0.0.1"; static VERSION: &'static str = "0.0.1";

View file

@ -11,6 +11,7 @@ path = "expr.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="expr" name="expr"

View file

@ -12,9 +12,9 @@
extern crate getopts; extern crate getopts;
extern crate libc; extern crate libc;
#[path="../common/util.rs"]
#[macro_use] #[macro_use]
mod util; extern crate uucore;
mod tokens; mod tokens;
mod syntax_tree; mod syntax_tree;

View file

@ -11,6 +11,7 @@ path = "factor.rs"
getopts = "*" getopts = "*"
libc = "*" libc = "*"
rand = "*" rand = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="factor" name="factor"

View file

@ -17,6 +17,9 @@ extern crate getopts;
extern crate libc; extern crate libc;
extern crate rand; extern crate rand;
#[macro_use]
extern crate uucore;
use numeric::*; use numeric::*;
use prime_table::P_INVS_U64; use prime_table::P_INVS_U64;
use rand::weak_rng; use rand::weak_rng;
@ -26,9 +29,6 @@ use std::io::{stdin, BufRead, BufReader, Write};
use std::num::Wrapping; use std::num::Wrapping;
use std::mem::swap; use std::mem::swap;
#[path="../common/util.rs"]
#[macro_use]
mod util;
mod numeric; mod numeric;
mod prime_table; mod prime_table;

View file

@ -11,6 +11,7 @@ path = "fmt.rs"
getopts = "*" getopts = "*"
libc = "*" libc = "*"
unicode-width = "*" unicode-width = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="fmt" name="fmt"

View file

@ -14,6 +14,9 @@ extern crate getopts;
extern crate rustc_unicode; extern crate rustc_unicode;
extern crate unicode_width; extern crate unicode_width;
#[macro_use]
extern crate uucore;
use std::cmp; use std::cmp;
use std::io::{Read, BufReader, BufWriter}; use std::io::{Read, BufReader, BufWriter};
use std::fs::File; use std::fs::File;
@ -30,9 +33,6 @@ macro_rules! silent_unwrap(
) )
); );
#[path = "../common/util.rs"]
#[macro_use]
mod util;
mod linebreak; mod linebreak;
mod parasplit; mod parasplit;

View file

@ -10,6 +10,7 @@ path = "fold.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="fold" name="fold"

View file

@ -12,14 +12,13 @@
extern crate getopts; extern crate getopts;
extern crate libc; extern crate libc;
#[macro_use]
extern crate uucore;
use std::fs::File; use std::fs::File;
use std::io::{BufRead, BufReader, Read, stdin, Write}; use std::io::{BufRead, BufReader, Read, stdin, Write};
use std::path::Path; use std::path::Path;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "fold"; static NAME: &'static str = "fold";
static VERSION: &'static str = "1.0.0"; static VERSION: &'static str = "1.0.0";

View file

@ -10,6 +10,7 @@ path = "groups.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="groups" name="groups"

View file

@ -9,13 +9,14 @@
* file that was distributed with this source code. * file that was distributed with this source code.
* *
*/ */
extern crate getopts; extern crate getopts;
use c_types::{get_pw_from_args, group}; #[macro_use]
use std::io::Write; extern crate uucore;
#[path = "../common/util.rs"] #[macro_use] mod util; use std::io::Write;
#[path = "../common/c_types.rs"] mod c_types; use uucore::c_types::{get_pw_from_args, group};
static NAME: &'static str = "groups"; static NAME: &'static str = "groups";
static VERSION: &'static str = "1.0.0"; static VERSION: &'static str = "1.0.0";

View file

@ -13,6 +13,7 @@ libc = "*"
regex = "*" regex = "*"
regex-syntax = "*" regex-syntax = "*"
rust-crypto = "*" rust-crypto = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="hashsum" name="hashsum"

View file

@ -16,6 +16,9 @@ extern crate getopts;
extern crate regex_syntax; extern crate regex_syntax;
extern crate regex; extern crate regex;
#[macro_use]
extern crate uucore;
use crypto::digest::Digest; use crypto::digest::Digest;
use crypto::md5::Md5; use crypto::md5::Md5;
use crypto::sha1::Sha1; use crypto::sha1::Sha1;
@ -26,10 +29,6 @@ use std::fs::File;
use std::io::{self, BufRead, BufReader, Read, stdin, Write}; use std::io::{self, BufRead, BufReader, Read, stdin, Write};
use std::path::Path; use std::path::Path;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "hashsum"; static NAME: &'static str = "hashsum";
static VERSION: &'static str = "1.0.0"; static VERSION: &'static str = "1.0.0";

View file

@ -10,6 +10,7 @@ path = "head.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="head" name="head"

View file

@ -13,15 +13,14 @@
extern crate getopts; extern crate getopts;
#[macro_use]
extern crate uucore;
use std::io::{BufRead, BufReader, Read, stdin, Write}; use std::io::{BufRead, BufReader, Read, stdin, Write};
use std::fs::File; use std::fs::File;
use std::path::Path; use std::path::Path;
use std::str::from_utf8; use std::str::from_utf8;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "head"; static NAME: &'static str = "head";
static VERSION: &'static str = "1.0.0"; static VERSION: &'static str = "1.0.0";

View file

@ -10,6 +10,7 @@ path = "hostid.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="hostid" name="hostid"

View file

@ -12,11 +12,10 @@
extern crate getopts; extern crate getopts;
extern crate libc; extern crate libc;
use libc::c_long;
#[path = "../common/util.rs"]
#[macro_use] #[macro_use]
mod util; extern crate uucore;
use libc::c_long;
static NAME: &'static str = "hostid"; static NAME: &'static str = "hostid";
static VERSION: &'static str = "0.0.1"; static VERSION: &'static str = "0.0.1";

View file

@ -10,6 +10,7 @@ path = "hostname.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="hostname" name="hostname"

View file

@ -16,16 +16,15 @@
extern crate getopts; extern crate getopts;
extern crate libc; extern crate libc;
#[macro_use]
extern crate uucore;
use getopts::Options;
use std::collections::hash_set::HashSet; use std::collections::hash_set::HashSet;
use std::iter::repeat; use std::iter::repeat;
use std::str; use std::str;
use std::io::Write; use std::io::Write;
use std::net::ToSocketAddrs; use std::net::ToSocketAddrs;
use getopts::Options;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "hostname"; static NAME: &'static str = "hostname";

View file

@ -10,6 +10,7 @@ path = "id.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="id" name="id"

View file

@ -17,11 +17,14 @@
extern crate getopts; extern crate getopts;
extern crate libc; extern crate libc;
#[macro_use]
extern crate uucore;
use libc::{getgid, getuid, uid_t, getegid, geteuid, getlogin}; use libc::{getgid, getuid, uid_t, getegid, geteuid, getlogin};
use std::ffi::CStr; use std::ffi::CStr;
use std::io::Write; use std::io::Write;
use std::ptr::read; use std::ptr::read;
use c_types::{ use uucore::c_types::{
c_passwd, c_passwd,
c_group, c_group,
get_groups, get_groups,
@ -31,9 +34,6 @@ use c_types::{
group group
}; };
#[path = "../common/util.rs"] #[macro_use] mod util;
#[path = "../common/c_types.rs"] mod c_types;
#[cfg(not(target_os = "linux"))] #[cfg(not(target_os = "linux"))]
mod audit { mod audit {
pub use std::mem::uninitialized; pub use std::mem::uninitialized;

View file

@ -10,6 +10,7 @@ path = "kill.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="kill" name="kill"

View file

@ -12,19 +12,12 @@
extern crate getopts; extern crate getopts;
extern crate libc; extern crate libc;
use libc::{c_int, pid_t};
use signals::ALL_SIGNALS;
use std::io::{Error, Write};
#[path = "../common/util.rs"]
#[macro_use] #[macro_use]
mod util; extern crate uucore;
#[path = "../common/c_types.rs"] use libc::{c_int, pid_t};
mod c_types; use std::io::{Error, Write};
use uucore::signals::ALL_SIGNALS;
#[path = "../common/signals.rs"]
mod signals;
static NAME: &'static str = "kill"; static NAME: &'static str = "kill";
static VERSION: &'static str = "0.0.1"; static VERSION: &'static str = "0.0.1";
@ -96,7 +89,7 @@ fn handle_obsolete(mut args: Vec<String>) -> (Vec<String>, Option<String>) {
let val = &slice[1..]; let val = &slice[1..];
match val.parse() { match val.parse() {
Ok(num) => { Ok(num) => {
if signals::is_signal(num) { if uucore::signals::is_signal(num) {
args.remove(i); args.remove(i);
return (args, Some(val.to_string())); return (args, Some(val.to_string()));
} }
@ -174,7 +167,7 @@ Usage:
fn kill(signalname: &str, pids: std::vec::Vec<String>) -> i32 { fn kill(signalname: &str, pids: std::vec::Vec<String>) -> i32 {
let mut status = 0; let mut status = 0;
let optional_signal_value = signals::signal_by_name_or_value(signalname); let optional_signal_value = uucore::signals::signal_by_name_or_value(signalname);
let signal_value = match optional_signal_value { let signal_value = match optional_signal_value {
Some(x) => x, Some(x) => x,
None => crash!(EXIT_ERR, "unknown signal name {}", signalname) None => crash!(EXIT_ERR, "unknown signal name {}", signalname)

View file

@ -10,6 +10,7 @@ path = "link.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="link" name="link"

View file

@ -11,14 +11,13 @@
extern crate getopts; extern crate getopts;
#[macro_use]
extern crate uucore;
use std::fs::hard_link; use std::fs::hard_link;
use std::io::Write; use std::io::Write;
use std::path::Path; use std::path::Path;
#[path="../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "link"; static NAME: &'static str = "link";
static VERSION: &'static str = "1.0.0"; static VERSION: &'static str = "1.0.0";

View file

@ -10,6 +10,7 @@ path = "ln.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="ln" name="ln"

View file

@ -11,20 +11,15 @@
extern crate getopts; extern crate getopts;
#[macro_use]
extern crate uucore;
use std::fs; use std::fs;
use std::io::{BufRead, BufReader, Result, stdin, Write}; use std::io::{BufRead, BufReader, Result, stdin, Write};
#[cfg(unix)] use std::os::unix::fs::symlink as symlink_file; #[cfg(unix)] use std::os::unix::fs::symlink as symlink_file;
#[cfg(windows)] use std::os::windows::fs::symlink_file; #[cfg(windows)] use std::os::windows::fs::symlink_file;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use uucore::fs::UUPathExt;
#[path="../common/util.rs"]
#[macro_use]
mod util;
#[path="../common/filesystem.rs"]
mod filesystem;
use filesystem::UUPathExt;
static NAME: &'static str = "ln"; static NAME: &'static str = "ln";
static VERSION: &'static str = "1.0.0"; static VERSION: &'static str = "1.0.0";

View file

@ -10,6 +10,7 @@ path = "logname.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="logname" name="logname"

View file

@ -14,11 +14,12 @@
extern crate getopts; extern crate getopts;
extern crate libc; extern crate libc;
#[macro_use]
extern crate uucore;
use std::ffi::CStr; use std::ffi::CStr;
use std::io::Write; use std::io::Write;
#[path = "../common/util.rs"] #[macro_use] mod util;
extern { extern {
// POSIX requires using getlogin (or equivalent code) // POSIX requires using getlogin (or equivalent code)
pub fn getlogin() -> *const libc::c_char; pub fn getlogin() -> *const libc::c_char;

View file

@ -10,6 +10,7 @@ path = "mkdir.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="mkdir" name="mkdir"

View file

@ -12,19 +12,14 @@
extern crate getopts; extern crate getopts;
extern crate libc; extern crate libc;
#[macro_use]
extern crate uucore;
use std::ffi::CString; use std::ffi::CString;
use std::fs; use std::fs;
use std::io::{Error, Write}; use std::io::{Error, Write};
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use uucore::fs::UUPathExt;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
#[path = "../common/filesystem.rs"]
mod filesystem;
use filesystem::UUPathExt;
static NAME: &'static str = "mkdir"; static NAME: &'static str = "mkdir";
static VERSION: &'static str = "1.0.0"; static VERSION: &'static str = "1.0.0";

View file

@ -10,6 +10,7 @@ path = "mkfifo.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="mkfifo" name="mkfifo"

View file

@ -12,14 +12,13 @@
extern crate getopts; extern crate getopts;
extern crate libc; extern crate libc;
#[macro_use]
extern crate uucore;
use libc::mkfifo; use libc::mkfifo;
use std::ffi::CString; use std::ffi::CString;
use std::io::{Error, Write}; use std::io::{Error, Write};
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "mkfifo"; static NAME: &'static str = "mkfifo";
static VERSION: &'static str = "1.0.0"; static VERSION: &'static str = "1.0.0";

View file

@ -10,6 +10,7 @@ path = "mv.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
uucore = { path="../uucore" }
[dev-dependencies] [dev-dependencies]
time = "*" time = "*"

View file

@ -13,19 +13,14 @@
extern crate getopts; extern crate getopts;
extern crate libc; extern crate libc;
#[macro_use]
extern crate uucore;
use std::fs; use std::fs;
use std::io::{BufRead, BufReader, Result, stdin, Write}; use std::io::{BufRead, BufReader, Result, stdin, Write};
use std::os::unix::fs::MetadataExt; use std::os::unix::fs::MetadataExt;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use uucore::fs::UUPathExt;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
#[path = "../common/filesystem.rs"]
mod filesystem;
use filesystem::UUPathExt;
static NAME: &'static str = "mv"; static NAME: &'static str = "mv";
static VERSION: &'static str = "0.0.1"; static VERSION: &'static str = "0.0.1";

View file

@ -10,6 +10,7 @@ path = "nice.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="nice" name="nice"

View file

@ -12,6 +12,9 @@
extern crate getopts; extern crate getopts;
extern crate libc; extern crate libc;
#[macro_use]
extern crate uucore;
use libc::{c_char, c_int, execvp}; use libc::{c_char, c_int, execvp};
use std::ffi::CString; use std::ffi::CString;
use std::io::{Error, Write}; use std::io::{Error, Write};
@ -22,10 +25,6 @@ const VERSION: &'static str = "1.0.0";
// XXX: PRIO_PROCESS is 0 on at least FreeBSD and Linux. Don't know about Mac OS X. // XXX: PRIO_PROCESS is 0 on at least FreeBSD and Linux. Don't know about Mac OS X.
const PRIO_PROCESS: c_int = 0; const PRIO_PROCESS: c_int = 0;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
extern { extern {
fn getpriority(which: c_int, who: c_int) -> c_int; fn getpriority(which: c_int, who: c_int) -> c_int;
fn setpriority(which: c_int, who: c_int, prio: c_int) -> c_int; fn setpriority(which: c_int, who: c_int, prio: c_int) -> c_int;

View file

@ -14,6 +14,7 @@ aho-corasick = "*"
memchr = "*" memchr = "*"
regex = "*" regex = "*"
regex-syntax = "*" regex-syntax = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="nl" name="nl"

View file

@ -16,14 +16,14 @@ extern crate memchr;
extern crate regex_syntax; extern crate regex_syntax;
extern crate regex; extern crate regex;
#[macro_use]
extern crate uucore;
use std::fs::File; use std::fs::File;
use std::io::{BufRead, BufReader, Read, stdin, Write}; use std::io::{BufRead, BufReader, Read, stdin, Write};
use std::iter::repeat; use std::iter::repeat;
use std::path::Path; use std::path::Path;
#[path="../common/util.rs"]
#[macro_use]
mod util;
mod helper; mod helper;
static NAME: &'static str = "nl"; static NAME: &'static str = "nl";

View file

@ -10,6 +10,7 @@ path = "nohup.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="nohup" name="nohup"

View file

@ -12,6 +12,9 @@
extern crate getopts; extern crate getopts;
extern crate libc; extern crate libc;
#[macro_use]
extern crate uucore;
use libc::{c_char, signal, dup2, execvp, isatty}; use libc::{c_char, signal, dup2, execvp, isatty};
use libc::{SIG_IGN, SIGHUP}; use libc::{SIG_IGN, SIGHUP};
use std::ffi::CString; use std::ffi::CString;
@ -21,9 +24,6 @@ use std::os::unix::prelude::*;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::env; use std::env;
#[path = "../common/util.rs"] #[macro_use] mod util;
#[path = "../common/c_types.rs"] mod c_types;
static NAME: &'static str = "nohup"; static NAME: &'static str = "nohup";
static VERSION: &'static str = "1.0.0"; static VERSION: &'static str = "1.0.0";

View file

@ -11,6 +11,7 @@ path = "nproc.rs"
getopts = "*" getopts = "*"
libc = "*" libc = "*"
num_cpus = "*" num_cpus = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="nproc" name="nproc"

View file

@ -12,16 +12,15 @@
extern crate getopts; extern crate getopts;
extern crate num_cpus; extern crate num_cpus;
#[macro_use]
extern crate uucore;
use std::io::Write; use std::io::Write;
use std::env; use std::env;
static NAME : &'static str = "nproc"; static NAME : &'static str = "nproc";
static VERSION : &'static str = "0.0.0"; static VERSION : &'static str = "0.0.0";
#[path = "../common/util.rs"]
#[macro_use]
mod util;
pub fn uumain(args: Vec<String>) -> i32 { pub fn uumain(args: Vec<String>) -> i32 {
let mut opts = getopts::Options::new(); let mut opts = getopts::Options::new();

View file

@ -10,6 +10,7 @@ path = "paste.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="paste" name="paste"

View file

@ -12,15 +12,14 @@
extern crate getopts; extern crate getopts;
extern crate libc; extern crate libc;
#[macro_use]
extern crate uucore;
use std::io::{BufRead, BufReader, Read, stdin, Write}; use std::io::{BufRead, BufReader, Read, stdin, Write};
use std::iter::repeat; use std::iter::repeat;
use std::fs::File; use std::fs::File;
use std::path::Path; use std::path::Path;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "paste"; static NAME: &'static str = "paste";
static VERSION: &'static str = "1.0.0"; static VERSION: &'static str = "1.0.0";

View file

@ -10,6 +10,7 @@ path = "printenv.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="printenv" name="printenv"

View file

@ -14,13 +14,12 @@
extern crate getopts; extern crate getopts;
extern crate libc; extern crate libc;
#[macro_use]
extern crate uucore;
use std::io::Write; use std::io::Write;
use std::env; use std::env;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "printenv"; static NAME: &'static str = "printenv";
static VERSION: &'static str = "1.0.0"; static VERSION: &'static str = "1.0.0";

View file

@ -14,6 +14,7 @@ aho-corasick = "*"
memchr = "*" memchr = "*"
regex-syntax = "*" regex-syntax = "*"
regex = "*" regex = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="ptx" name="ptx"

View file

@ -15,18 +15,16 @@ extern crate memchr;
extern crate regex_syntax; extern crate regex_syntax;
extern crate regex; extern crate regex;
#[macro_use]
extern crate uucore;
use getopts::{Options, Matches};
use regex::Regex;
use std::cmp;
use std::collections::{HashMap, HashSet, BTreeSet}; use std::collections::{HashMap, HashSet, BTreeSet};
use std::default::Default; use std::default::Default;
use std::fs::File; use std::fs::File;
use getopts::{Options, Matches};
use std::io::{stdin, stdout, BufReader, BufWriter, BufRead, Read, Write}; use std::io::{stdin, stdout, BufReader, BufWriter, BufRead, Read, Write};
use regex::Regex;
use std::cmp;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "ptx"; static NAME: &'static str = "ptx";
static VERSION: &'static str = "1.0.0"; static VERSION: &'static str = "1.0.0";

View file

@ -10,6 +10,7 @@ path = "pwd.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="pwd" name="pwd"

View file

@ -12,13 +12,12 @@
extern crate getopts; extern crate getopts;
extern crate libc; extern crate libc;
#[macro_use]
extern crate uucore;
use std::io::Write; use std::io::Write;
use std::env; use std::env;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "pwd"; static NAME: &'static str = "pwd";
static VERSION: &'static str = "1.0.0"; static VERSION: &'static str = "1.0.0";

View file

@ -10,6 +10,7 @@ path = "readlink.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="readlink" name="readlink"

View file

@ -11,18 +11,13 @@
extern crate getopts; extern crate getopts;
#[macro_use]
extern crate uucore;
use std::fs; use std::fs;
use std::io::Write; use std::io::Write;
use std::path::PathBuf; use std::path::PathBuf;
use uucore::fs::{canonicalize, CanonicalizeMode};
#[path = "../common/util.rs"]
#[macro_use]
mod util;
#[path = "../common/filesystem.rs"]
mod filesystem;
use filesystem::{canonicalize, CanonicalizeMode};
const NAME: &'static str = "readlink"; const NAME: &'static str = "readlink";
const VERSION: &'static str = "0.0.1"; const VERSION: &'static str = "0.0.1";

View file

@ -10,6 +10,7 @@ path = "realpath.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="realpath" name="realpath"

View file

@ -12,18 +12,13 @@
extern crate getopts; extern crate getopts;
extern crate libc; extern crate libc;
#[macro_use]
extern crate uucore;
use std::fs; use std::fs;
use std::io::Write; use std::io::Write;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use uucore::fs::{canonicalize, CanonicalizeMode};
#[path = "../common/util.rs"]
#[macro_use]
mod util;
#[path = "../common/filesystem.rs"]
mod filesystem;
use filesystem::{canonicalize, CanonicalizeMode};
static NAME: &'static str = "realpath"; static NAME: &'static str = "realpath";
static VERSION: &'static str = "1.0.0"; static VERSION: &'static str = "1.0.0";

View file

@ -10,6 +10,7 @@ path = "relpath.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="relpath" name="relpath"

View file

@ -12,18 +12,13 @@
extern crate getopts; extern crate getopts;
extern crate libc; extern crate libc;
#[macro_use]
extern crate uucore;
use std::env; use std::env;
use std::io::Write; use std::io::Write;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use uucore::fs::{canonicalize, CanonicalizeMode};
#[path = "../common/util.rs"]
#[macro_use]
mod util;
#[path = "../common/filesystem.rs"]
mod filesystem;
use filesystem::{canonicalize, CanonicalizeMode};
static NAME: &'static str = "relpath"; static NAME: &'static str = "relpath";
static VERSION: &'static str = "1.0.0"; static VERSION: &'static str = "1.0.0";

View file

@ -10,6 +10,7 @@ path = "rm.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="rm" name="rm"

View file

@ -12,20 +12,15 @@
extern crate getopts; extern crate getopts;
extern crate libc; extern crate libc;
#[macro_use]
extern crate uucore;
use std::collections::VecDeque; use std::collections::VecDeque;
use std::fs; use std::fs;
use std::io::{stdin, stderr, BufRead, Write}; use std::io::{stdin, stderr, BufRead, Write};
use std::ops::BitOr; use std::ops::BitOr;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use uucore::fs::UUPathExt;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
#[path = "../common/filesystem.rs"]
mod filesystem;
use filesystem::UUPathExt;
#[derive(Eq, PartialEq, Clone, Copy)] #[derive(Eq, PartialEq, Clone, Copy)]
enum InteractiveMode { enum InteractiveMode {

View file

@ -10,6 +10,7 @@ path = "rmdir.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="rmdir" name="rmdir"

View file

@ -12,14 +12,13 @@
extern crate getopts; extern crate getopts;
extern crate libc; extern crate libc;
#[macro_use]
extern crate uucore;
use std::fs; use std::fs;
use std::io::Write; use std::io::Write;
use std::path::Path; use std::path::Path;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "rmdir"; static NAME: &'static str = "rmdir";
static VERSION: &'static str = "1.0.0"; static VERSION: &'static str = "1.0.0";

View file

@ -10,6 +10,7 @@ path = "seq.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="seq" name="seq"

View file

@ -6,13 +6,12 @@
extern crate getopts; extern crate getopts;
extern crate libc; extern crate libc;
#[macro_use]
extern crate uucore;
use std::cmp; use std::cmp;
use std::io::Write; use std::io::Write;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "seq"; static NAME: &'static str = "seq";
static VERSION: &'static str = "1.0.0"; static VERSION: &'static str = "1.0.0";

View file

@ -11,6 +11,7 @@ path = "shuf.rs"
getopts = "*" getopts = "*"
libc = "*" libc = "*"
rand = "*" rand = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="shuf" name="shuf"

View file

@ -13,16 +13,15 @@ extern crate getopts;
extern crate libc; extern crate libc;
extern crate rand; extern crate rand;
#[macro_use]
extern crate uucore;
use rand::{Rng, ThreadRng}; use rand::{Rng, ThreadRng};
use rand::read::ReadRng; use rand::read::ReadRng;
use std::fs::File; use std::fs::File;
use std::io::{stdin, stdout, BufReader, BufWriter, Read, Write}; use std::io::{stdin, stdout, BufReader, BufWriter, Read, Write};
use std::usize::MAX as MAX_USIZE; use std::usize::MAX as MAX_USIZE;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
enum Mode { enum Mode {
Default, Default,
Echo, Echo,

View file

@ -10,6 +10,7 @@ path = "sleep.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="sleep" name="sleep"

View file

@ -12,18 +12,14 @@
extern crate getopts; extern crate getopts;
extern crate libc; extern crate libc;
#[macro_use]
extern crate uucore;
use std::io::Write; use std::io::Write;
use std::thread::{self}; use std::thread::{self};
use std::time::Duration; use std::time::Duration;
use std::u32::MAX as U32_MAX; use std::u32::MAX as U32_MAX;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
#[path = "../common/parse_time.rs"]
mod parse_time;
static NAME: &'static str = "sleep"; static NAME: &'static str = "sleep";
static VERSION: &'static str = "1.0.0"; static VERSION: &'static str = "1.0.0";
@ -68,7 +64,7 @@ specified by the sum of their values.", NAME, VERSION);
fn sleep(args: Vec<String>) { fn sleep(args: Vec<String>) {
let sleep_time = args.iter().fold(0.0, |result, arg| let sleep_time = args.iter().fold(0.0, |result, arg|
match parse_time::from_str(&arg[..]) { match uucore::parse_time::from_str(&arg[..]) {
Ok(m) => m + result, Ok(m) => m + result,
Err(f) => crash!(1, "{}", f), Err(f) => crash!(1, "{}", f),
}); });

View file

@ -10,6 +10,7 @@ path = "sort.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="sort" name="sort"

View file

@ -14,6 +14,9 @@
extern crate getopts; extern crate getopts;
extern crate libc; extern crate libc;
#[macro_use]
extern crate uucore;
use libc::STDIN_FILENO; use libc::STDIN_FILENO;
use libc::{c_int, isatty}; use libc::{c_int, isatty};
use std::cmp::Ordering; use std::cmp::Ordering;
@ -21,10 +24,6 @@ use std::fs::File;
use std::io::{BufRead, BufReader, Read, stdin, Write}; use std::io::{BufRead, BufReader, Read, stdin, Write};
use std::path::Path; use std::path::Path;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "sort"; static NAME: &'static str = "sort";
static VERSION: &'static str = "0.0.1"; static VERSION: &'static str = "0.0.1";

View file

@ -10,6 +10,7 @@ path = "split.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="split" name="split"

View file

@ -12,15 +12,14 @@
extern crate getopts; extern crate getopts;
extern crate libc; extern crate libc;
#[macro_use]
extern crate uucore;
use std::char; use std::char;
use std::fs::{File, OpenOptions}; use std::fs::{File, OpenOptions};
use std::io::{BufRead, BufReader, BufWriter, Read, stdin, stdout, Write}; use std::io::{BufRead, BufReader, BufWriter, Read, stdin, stdout, Write};
use std::path::Path; use std::path::Path;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "split"; static NAME: &'static str = "split";
static VERSION: &'static str = "1.0.0"; static VERSION: &'static str = "1.0.0";

View file

@ -10,6 +10,7 @@ path = "stdbuf.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="stdbuf" name="stdbuf"

View file

@ -3,15 +3,14 @@
extern crate libc; extern crate libc;
#[macro_use]
extern crate uucore;
use libc::{c_int, size_t, c_char, FILE, _IOFBF, _IONBF, _IOLBF, setvbuf}; use libc::{c_int, size_t, c_char, FILE, _IOFBF, _IONBF, _IOLBF, setvbuf};
use std::env; use std::env;
use std::io::Write; use std::io::Write;
use std::ptr; use std::ptr;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
extern { extern {
static stdin: *mut FILE; static stdin: *mut FILE;
static stdout: *mut FILE; static stdout: *mut FILE;

View file

@ -12,20 +12,15 @@
extern crate getopts; extern crate getopts;
extern crate libc; extern crate libc;
#[macro_use]
extern crate uucore;
use getopts::{Matches, Options}; use getopts::{Matches, Options};
use std::io::{self, Write}; use std::io::{self, Write};
use std::os::unix::process::ExitStatusExt; use std::os::unix::process::ExitStatusExt;
use std::path::PathBuf; use std::path::PathBuf;
use std::process::Command; use std::process::Command;
use uucore::fs::{canonicalize, CanonicalizeMode, UUPathExt};
#[path = "../common/util.rs"]
#[macro_use]
mod util;
#[path = "../common/filesystem.rs"]
mod filesystem;
use filesystem::{canonicalize, CanonicalizeMode, UUPathExt};
static NAME: &'static str = "stdbuf"; static NAME: &'static str = "stdbuf";
static VERSION: &'static str = "1.0.0"; static VERSION: &'static str = "1.0.0";

View file

@ -10,6 +10,7 @@ path = "sum.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
uucore = { path="../uucore" }
[[bin]] [[bin]]
name="sum" name="sum"

Some files were not shown because too many files have changed in this diff Show more