1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-31 21:17:46 +00:00

Use new macro feature flags/attributes

This commit is contained in:
Michael Gehring 2015-01-08 13:54:22 +01:00
parent 7667369983
commit 1b381f49fa
62 changed files with 65 additions and 127 deletions

View file

@ -9,13 +9,10 @@
* that was distributed with this source code.
*/
#![feature(phase)]
#![feature(macro_rules)]
extern crate serialize;
extern crate getopts;
extern crate libc;
#[phase(plugin, link)] extern crate log;
#[macro_use] extern crate log;
use std::ascii::AsciiExt;
use std::io::{println, File, stdout};
@ -31,6 +28,7 @@ use serialize::base64;
use serialize::base64::{FromBase64, ToBase64};
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "base64";

View file

@ -1,4 +1,3 @@
#![feature(macro_rules)]
#![crate_name = "basename"]
/*
@ -17,6 +16,7 @@ use std::borrow::ToOwned;
use std::io::{print, println};
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "basename";

View file

@ -9,14 +9,12 @@
* file that was distributed with this source code.
*/
#![feature(macro_rules, phase)]
#![allow(unused_variables)] // only necessary while the TODOs still exist
extern crate getopts;
extern crate libc;
extern crate regex;
#[phase(plugin)] extern crate regex_macros;
#[macro_use] extern crate regex_macros;
use std::io::fs;
use std::io::fs::PathExtensions;
@ -26,6 +24,7 @@ use std::num::from_str_radix;
use regex::Regex;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
const NAME: &'static str = "chmod";

View file

@ -8,7 +8,6 @@
* file that was distributed with this source code.
*/
#![feature(macro_rules)]
extern crate getopts;
extern crate libc;
@ -17,7 +16,7 @@ use c_types::{get_pw_from_args, get_group};
use libc::funcs::posix88::unistd::{execvp, setuid, setgid};
use std::io::fs::PathExtensions;
#[path = "../common/util.rs"] mod util;
#[path = "../common/util.rs"] #[macro_use] mod util;
#[path = "../common/c_types.rs"] mod c_types;
extern {

View file

@ -1,5 +1,4 @@
#![crate_name = "cksum"]
#![feature(macro_rules)]
/*
* This file is part of the uutils coreutils package.
@ -19,6 +18,7 @@ use std::mem;
use crc_table::CRC_TABLE;
#[path="../common/util.rs"]
#[macro_use]
mod util;
mod crc_table;

View file

@ -7,11 +7,8 @@
* file that was distributed with this source code.
*/
#![macro_escape]
extern crate libc;
#[macro_export]
macro_rules! show_error(
($($args:expr),+) => ({
pipe_write!(&mut ::std::io::stderr(), "{}: error: ", ::NAME);

View file

@ -1,6 +1,4 @@
#![crate_name = "cp"]
#![feature(macro_rules)]
#![feature(phase)]
/*
* This file is part of the uutils coreutils package.
@ -12,7 +10,7 @@
*/
extern crate getopts;
#[phase(plugin, link)] extern crate log;
#[macro_use] extern crate log;
use std::os;
use std::io;

View file

@ -9,8 +9,6 @@
* file that was distributed with this source code.
*/
#![feature(macro_rules)]
extern crate getopts;
extern crate libc;
@ -21,6 +19,7 @@ use getopts::{optopt, optflag, getopts, usage};
use ranges::Range;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
mod ranges;
mod buffer;

View file

@ -10,7 +10,6 @@
*/
#![allow(non_snake_case)]
#![feature(macro_rules)]
extern crate getopts;
extern crate libc;
@ -25,6 +24,7 @@ use std::str::from_utf8;
use time::Timespec;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "du";

View file

@ -1,4 +1,3 @@
#![feature(macro_rules)]
#![crate_name = "echo"]
/*

View file

@ -9,8 +9,6 @@
* file that was distributed with this source code.
*/
#![feature(macro_rules)]
extern crate getopts;
extern crate libc;
@ -18,6 +16,7 @@ use std::io;
use std::str::from_str;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "expand";

View file

@ -1,5 +1,4 @@
#![crate_name = "factor"]
#![feature(macro_rules)]
/*
* This file is part of the uutils coreutils package.
@ -18,6 +17,7 @@ use std::io::BufferedReader;
use std::io::stdio::stdin_raw;
#[path="../common/util.rs"]
#[macro_use]
mod util;
static VERSION: &'static str = "1.0.0";

View file

@ -8,8 +8,6 @@
* file that was distributed with this source code.
*/
#![feature(macro_rules)]
extern crate core;
extern crate getopts;
@ -19,7 +17,6 @@ use std::io::stdio::{stdin_raw, stdout_raw};
use linebreak::break_lines;
use parasplit::ParagraphStream;
#[macro_export]
macro_rules! silent_unwrap(
($exp:expr) => (
match $exp {
@ -28,7 +25,9 @@ macro_rules! silent_unwrap(
}
)
);
#[path = "../common/util.rs"]
#[macro_use]
mod util;
mod linebreak;
mod parasplit;

View file

@ -9,8 +9,6 @@
* file that was distributed with this source code.
*/
#![feature(macro_rules)]
extern crate getopts;
extern crate libc;
@ -19,6 +17,7 @@ use std::io::fs::File;
use std::io::BufferedReader;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "fold";

View file

@ -8,8 +8,6 @@
* file that was distributed with this source code.
*
*/
#![feature(macro_rules)]
extern crate getopts;
use getopts::{
@ -19,7 +17,7 @@ use getopts::{
};
use c_types::{get_pw_from_args, group};
#[path = "../common/util.rs"] mod util;
#[path = "../common/util.rs"] #[macro_use] mod util;
#[path = "../common/c_types.rs"] mod c_types;
static NAME: &'static str = "groups";

View file

@ -11,8 +11,6 @@
* file that was distributed with this source code.
*/
#![feature(macro_rules)]
extern crate regex;
extern crate crypto;
@ -31,6 +29,7 @@ use crypto::sha1::Sha1;
use crypto::sha2::{Sha224, Sha256, Sha384, Sha512};
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "hashsum";

View file

@ -10,8 +10,6 @@
* Synced with: https://raw.github.com/avsm/src/master/usr.bin/head/head.c
*/
#![feature(macro_rules)]
extern crate getopts;
use std::char::UnicodeChar;
@ -23,6 +21,7 @@ use std::str::from_utf8;
use getopts::{optopt, optflag, getopts, usage};
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "head";

View file

@ -1,6 +1,4 @@
#![crate_name = "hostid"]
#![feature(macro_rules)]
#![feature(phase)]
/*
* This file is part of the uutils coreutils package.
@ -18,7 +16,7 @@ extern crate serialize;
extern crate libc;
#[phase(plugin, link)] extern crate log;
#[macro_use] extern crate log;
use getopts::{
getopts,
@ -29,6 +27,7 @@ use getopts::{
use libc::{c_long};
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "hostid";

View file

@ -12,8 +12,6 @@
* https://www.opensource.apple.com/source/shell_cmds/shell_cmds-170/hostname/hostname.c?txt
*/
#![feature(macro_rules)]
extern crate getopts;
extern crate libc;
@ -23,6 +21,7 @@ use std::str;
use getopts::{optflag, getopts, usage};
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "hostname";

View file

@ -14,7 +14,6 @@
*/
#![allow(non_camel_case_types)]
#![feature(macro_rules)]
extern crate getopts;
extern crate libc;
@ -36,7 +35,7 @@ use c_types::{
group
};
#[path = "../common/util.rs"] mod util;
#[path = "../common/util.rs"] #[macro_use] mod util;
#[path = "../common/c_types.rs"] mod c_types;
#[cfg(not(target_os = "linux"))]

View file

@ -1,6 +1,4 @@
#![crate_name = "kill"]
#![feature(macro_rules)]
#![feature(phase)]
/*
* This file is part of the uutils coreutils package.
@ -17,7 +15,7 @@ extern crate libc;
extern crate collections;
extern crate serialize;
#[phase(plugin, link)] extern crate log;
#[macro_use] extern crate log;
use std::io::process::Process;
@ -32,6 +30,7 @@ use getopts::{
use signals::ALL_SIGNALS;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
#[path = "../common/signals.rs"]

View file

@ -1,5 +1,4 @@
#![crate_name = "link"]
#![feature(macro_rules)]
/*
* This file is part of the uutils coreutils package.
@ -16,6 +15,7 @@ use std::io::fs::link;
use std::path::Path;
#[path="../common/util.rs"]
#[macro_use]
mod util;
static NAME : &'static str = "link";

View file

@ -13,15 +13,13 @@
#![allow(non_camel_case_types)]
#![feature(macro_rules)]
extern crate getopts;
extern crate libc;
use std::io::print;
use libc::c_char;
#[path = "../common/util.rs"] mod util;
#[path = "../common/util.rs"] #[macro_use] mod util;
extern {
// POSIX requires using getlogin (or equivalent code)

View file

@ -9,8 +9,6 @@
* file that was distributed with this source code.
*/
#![feature(macro_rules)]
extern crate getopts;
extern crate libc;
@ -19,6 +17,7 @@ use std::io::FilePermission;
use std::num::from_str_radix;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "mkdir";

View file

@ -1,5 +1,4 @@
#![crate_name = "mkfifo"]
#![feature(macro_rules)]
/*
* This file is part of the uutils coreutils package.
@ -18,6 +17,7 @@ use std::os;
use libc::funcs::posix88::stat_::mkfifo;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME : &'static str = "mkfifo";

View file

@ -10,8 +10,6 @@
* that was distributed with this source code.
*/
#![feature(macro_rules)]
extern crate getopts;
use std::io::{BufferedReader, IoResult, fs};
@ -28,6 +26,7 @@ use getopts::{
use std::borrow::ToOwned;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "mv";

View file

@ -9,8 +9,6 @@
* file that was distributed with this source code.
*/
#![feature(macro_rules)]
extern crate getopts;
extern crate libc;
@ -26,6 +24,7 @@ const VERSION: &'static str = "1.0.0";
const PRIO_PROCESS: c_int = 0;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
extern {

View file

@ -1,5 +1,4 @@
#![crate_name = "nl"]
#![feature(macro_rules)]
/*
* This file is part of the uutils coreutils package.
*
@ -10,9 +9,7 @@
*
*/
#![feature(phase)]
#[phase(plugin)]
extern crate regex_macros;
#[macro_use] extern crate regex_macros;
extern crate regex;
extern crate getopts;
@ -24,6 +21,7 @@ use std::path::Path;
use getopts::{optopt, optflag, getopts, usage, OptGroup};
#[path="../common/util.rs"]
#[macro_use]
mod util;
mod helper;

View file

@ -9,7 +9,6 @@
* file that was distributed with this source code.
*/
#![feature(globs, macro_rules)]
extern crate getopts;
extern crate libc;
@ -22,7 +21,7 @@ use libc::consts::os::posix88::SIGHUP;
use libc::funcs::posix01::signal::signal;
use libc::consts::os::posix01::SIG_IGN;
#[path = "../common/util.rs"] mod util;
#[path = "../common/util.rs"] #[macro_use] mod util;
#[path = "../common/c_types.rs"] mod c_types;
static NAME: &'static str = "nohup";

View file

@ -9,8 +9,6 @@
* file that was distributed with this source code.
*/
#![feature(macro_rules)]
extern crate getopts;
use std::os;
@ -19,6 +17,7 @@ static NAME : &'static str = "nproc";
static VERSION : &'static str = "0.0.0";
#[path = "../common/util.rs"]
#[macro_use]
mod util;
pub fn uumain(args: Vec<String>) -> int {

View file

@ -9,14 +9,13 @@
* file that was distributed with this source code.
*/
#![feature(macro_rules)]
extern crate getopts;
extern crate libc;
use std::io;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "paste";

View file

@ -11,8 +11,6 @@
/* last synced with: printenv (GNU coreutils) 8.13 */
#![feature(macro_rules)]
extern crate getopts;
extern crate libc;
@ -20,6 +18,7 @@ use std::os;
use std::io::print;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "printenv";

View file

@ -9,14 +9,13 @@
* file that was distributed with this source code.
*/
#![feature(macro_rules)]
extern crate getopts;
extern crate libc;
use std::io::print;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "pwd";

View file

@ -9,13 +9,12 @@
* file that was distributed with this source code.
*/
#![feature(macro_rules)]
extern crate getopts;
extern crate libc;
use getopts::{optflag, getopts, usage};
#[path = "../common/util.rs"] mod util;
#[path = "../common/util.rs"] #[macro_use] mod util;
static NAME: &'static str = "realpath";
static VERSION: &'static str = "1.0.0";

View file

@ -9,13 +9,12 @@
* file that was distributed with this source code.
*/
#![feature(macro_rules)]
extern crate getopts;
extern crate libc;
use getopts::{optflag, optopt, getopts, usage};
#[path = "../common/util.rs"] mod util;
#[path = "../common/util.rs"] #[macro_use] mod util;
static NAME: &'static str = "relpath";
static VERSION: &'static str = "1.0.0";

View file

@ -9,8 +9,6 @@
* file that was distributed with this source code.
*/
#![feature(macro_rules)]
extern crate getopts;
extern crate libc;
@ -18,6 +16,7 @@ use std::io::{print, stdin, stdio, fs, BufferedReader};
use std::io::fs::PathExtensions;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
#[deriving(Eq, PartialEq)]

View file

@ -9,8 +9,6 @@
* file that was distributed with this source code.
*/
#![feature(macro_rules)]
extern crate getopts;
extern crate libc;
@ -18,6 +16,7 @@ use std::io::{print, fs};
use std::io::fs::PathExtensions;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "rmdir";

View file

@ -1,7 +1,5 @@
#![crate_name = "seq"]
#![feature(macro_rules)]
// TODO: Make -w flag work with decimals
// TODO: Support -f flag
@ -11,6 +9,7 @@ extern crate libc;
use std::cmp;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "seq";

View file

@ -9,8 +9,6 @@
* file that was distributed with this source code.
*/
#![feature(macro_rules)]
extern crate getopts;
extern crate libc;
@ -23,6 +21,7 @@ use std::rand::{mod, Rng};
use std::uint;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
enum Mode {

View file

@ -9,8 +9,6 @@
* file that was distributed with this source code.
*/
#![feature(macro_rules)]
extern crate getopts;
extern crate libc;
@ -19,6 +17,7 @@ use std::io::{print, timer};
use std::time::duration::{mod, Duration};
#[path = "../common/util.rs"]
#[macro_use]
mod util;
#[path = "../common/time.rs"]

View file

@ -1,5 +1,4 @@
#![crate_name = "sort"]
#![feature(macro_rules)]
/*
* This file is part of the uutils coreutils package.
@ -20,6 +19,7 @@ use std::io::stdio::stdin_raw;
use std::str::Chars;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "sort";

View file

@ -9,8 +9,6 @@
* file that was distributed with this source code.
*/
#![feature(macro_rules)]
extern crate getopts;
extern crate libc;
@ -19,6 +17,7 @@ use std::num::Int;
use std::char;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "split";

View file

@ -1,5 +1,4 @@
#![crate_name = "sum"]
#![feature(macro_rules)]
/*
* This file is part of the uutils coreutils package.
@ -17,6 +16,7 @@ use std::io::{File, IoResult, print};
use std::io::stdio::{stdin_raw};
#[path="../common/util.rs"]
#[macro_use]
mod util;
static VERSION: &'static str = "1.0.0";

View file

@ -10,14 +10,12 @@
/* Last synced with: sync (GNU coreutils) 8.13 */
#![feature(macro_rules)]
extern crate getopts;
extern crate libc;
use getopts::{optflag, getopts, usage};
#[path = "../common/util.rs"] mod util;
#[path = "../common/util.rs"] #[macro_use] mod util;
static NAME: &'static str = "sync";
static VERSION: &'static str = "1.0.0";

View file

@ -9,14 +9,13 @@
* file that was distributed with this source code.
*/
#![feature(macro_rules)]
extern crate getopts;
extern crate libc;
use std::io;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "tac";

View file

@ -9,8 +9,6 @@
*
*/
#![feature(macro_rules)]
extern crate getopts;
use std::char::UnicodeChar;
@ -25,6 +23,7 @@ use std::io::timer::sleep;
use std::time::duration::Duration;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "tail";

View file

@ -9,8 +9,6 @@
* file that was distributed with this source code.
*/
#![feature(macro_rules)]
extern crate getopts;
extern crate libc;
@ -18,6 +16,7 @@ use std::io::{PathDoesntExist, FileNotFound};
use std::io::process::{Command, ExitStatus, ExitSignal, InheritFd};
#[path = "../common/util.rs"]
#[macro_use]
mod util;
#[path = "../common/time.rs"]

View file

@ -1,5 +1,4 @@
#![crate_name = "touch"]
#![feature(macro_rules)]
/*
* This file is part of the uutils coreutils package.
@ -17,6 +16,7 @@ use std::io::File;
use std::io::fs::PathExtensions;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "touch";

View file

@ -1,5 +1,4 @@
#![crate_name = "tr"]
#![feature(macro_rules)]
/*
* This file is part of the uutils coreutils package.
@ -22,6 +21,7 @@ use std::iter::FromIterator;
use std::vec::Vec;
#[path="../common/util.rs"]
#[macro_use]
mod util;
static NAME : &'static str = "tr";

View file

@ -9,8 +9,6 @@
* file that was distributed with this source code.
*/
#![feature(macro_rules)]
extern crate getopts;
extern crate libc;
@ -19,6 +17,7 @@ use std::io::{File, Open, ReadWrite, fs};
use std::io::fs::PathExtensions;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
#[deriving(Eq, PartialEq)]

View file

@ -10,8 +10,6 @@
* file that was distributed with this source code.
*/
#![feature(macro_rules)]
extern crate getopts;
extern crate libc;
@ -19,6 +17,7 @@ use std::io;
use std::collections::{HashSet, HashMap};
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "tsort";

View file

@ -14,8 +14,6 @@
#![allow(dead_code)]
#![feature(macro_rules)]
extern crate getopts;
extern crate libc;
@ -24,6 +22,7 @@ use std::io::stdio::stderr;
use getopts::{optflag,getopts};
#[path = "../common/util.rs"]
#[macro_use]
mod util;
extern {

View file

@ -12,7 +12,6 @@
/* last synced with: uname (GNU coreutils) 8.21 */
#![allow(non_camel_case_types)]
#![feature(macro_rules)]
extern crate getopts;
extern crate libc;
@ -21,7 +20,7 @@ use std::mem::uninitialized;
use std::io::print;
use c_types::utsname;
#[path = "../common/util.rs"] mod util;
#[path = "../common/util.rs"] #[macro_use] mod util;
#[path = "../common/c_types.rs"] mod c_types;
struct utsrust {

View file

@ -9,14 +9,13 @@
* file that was distributed with this source code.
*/
#![feature(macro_rules)]
extern crate getopts;
extern crate libc;
use std::io;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "unexpand";

View file

@ -9,8 +9,6 @@
*
*/
#![feature(macro_rules)]
extern crate getopts;
use std::ascii::OwnedAsciiExt;
@ -19,6 +17,7 @@ use std::str::FromStr;
use std::io;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "uniq";

View file

@ -11,8 +11,6 @@
/* last synced with: unlink (GNU coreutils) 8.21 */
#![feature(macro_rules)]
extern crate getopts;
extern crate libc;
@ -21,6 +19,7 @@ use std::io::fs::{mod, PathExtensions};
use std::io::print;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "unlink";

View file

@ -12,7 +12,6 @@
/* last synced with: cat (GNU coreutils) 8.13 */
#![allow(non_camel_case_types)]
#![feature(macro_rules, globs)]
extern crate getopts;
extern crate libc;
@ -24,7 +23,7 @@ use std::ptr::null;
use libc::{time_t, c_double, c_int, c_char};
use utmpx::*;
#[path = "../common/util.rs"] mod util;
#[path = "../common/util.rs"] #[macro_use] mod util;
#[path = "../common/c_types.rs"] mod c_types;

View file

@ -14,8 +14,6 @@
// Allow dead code here in order to keep all fields, constants here, for consistency.
#![allow(dead_code, non_camel_case_types)]
#![feature(macro_rules, globs)]
extern crate getopts;
extern crate libc;
@ -25,6 +23,7 @@ use std::ptr;
use utmpx::*;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
#[path = "../common/utmpx.rs"]

View file

@ -9,8 +9,6 @@
* file that was distributed with this source code.
*/
#![feature(macro_rules)]
extern crate getopts;
extern crate libc;
@ -23,6 +21,7 @@ use std::result::Result as StdResult;
use getopts::Matches;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
struct Result {

View file

@ -13,14 +13,12 @@
#![allow(non_camel_case_types)]
#![feature(macro_rules)]
extern crate getopts;
extern crate libc;
use std::io::print;
#[path = "../common/util.rs"] mod util;
#[path = "../common/util.rs"] #[macro_use] mod util;
#[cfg(unix)]
mod platform {

View file

@ -11,14 +11,13 @@
/* last synced with: yes (GNU coreutils) 8.13 */
#![feature(macro_rules)]
extern crate getopts;
extern crate libc;
use std::io::print;
#[path = "../common/util.rs"]
#[macro_use]
mod util;
static NAME: &'static str = "yes";

View file

@ -1,5 +1,3 @@
#![feature(macro_rules)]
extern crate time;
use std::io::{process, fs, FilePermission};