From 75f11e963584fd685a7cad5a97c2c2432a92c760 Mon Sep 17 00:00:00 2001 From: Alex Lyon Date: Thu, 7 Dec 2017 19:40:55 -0800 Subject: [PATCH] Handle SIGPIPE correctly and autogenerate main() for each util --- mkmain.rs | 36 ++ src/arch/Cargo.toml | 3 +- src/arch/main.rs | 5 - src/base32/Cargo.toml | 3 +- src/base32/main.rs | 5 - src/base64/Cargo.toml | 3 +- src/base64/main.rs | 5 - src/basename/Cargo.toml | 3 +- src/basename/main.rs | 5 - src/cat/Cargo.toml | 3 +- src/cat/main.rs | 5 - src/chgrp/Cargo.toml | 3 +- src/chgrp/main.rs | 5 - src/chmod/Cargo.toml | 3 +- src/chmod/main.rs | 5 - src/chown/Cargo.toml | 3 +- src/chown/main.rs | 5 - src/chroot/Cargo.toml | 3 +- src/chroot/main.rs | 5 - src/cksum/Cargo.toml | 2 +- src/cksum/{gen_table.rs => build.rs} | 19 +- src/cksum/cksum.rs | 4 +- src/cksum/crc_table.rs | 3 - src/cksum/main.rs | 5 - src/comm/Cargo.toml | 3 +- src/comm/main.rs | 5 - src/cp/Cargo.toml | 3 +- src/cp/main.rs | 5 - src/cut/Cargo.toml | 3 +- src/cut/main.rs | 5 - src/date/Cargo.toml | 3 +- src/date/main.rs | 5 - src/dircolors/Cargo.toml | 3 +- src/dircolors/main.rs | 5 - src/dirname/Cargo.toml | 3 +- src/dirname/main.rs | 5 - src/du/Cargo.toml | 3 +- src/du/main.rs | 5 - src/echo/Cargo.toml | 3 +- src/echo/main.rs | 5 - src/env/Cargo.toml | 3 +- src/env/main.rs | 5 - src/expand/Cargo.toml | 3 +- src/expand/main.rs | 5 - src/expr/Cargo.toml | 3 +- src/expr/main.rs | 5 - src/factor/Cargo.toml | 2 +- src/factor/{gen_table.rs => build.rs} | 21 +- src/factor/factor.rs | 10 +- src/factor/main.rs | 5 - src/factor/prime_table.rs | 532 -------------------------- src/false/Cargo.toml | 6 +- src/false/main.rs | 5 - src/fmt/Cargo.toml | 3 +- src/fmt/main.rs | 5 - src/fold/Cargo.toml | 3 +- src/fold/main.rs | 5 - src/groups/Cargo.toml | 3 +- src/groups/main.rs | 5 - src/hashsum/Cargo.toml | 3 +- src/hashsum/main.rs | 5 - src/head/Cargo.toml | 3 +- src/head/main.rs | 5 - src/hostid/Cargo.toml | 3 +- src/hostid/main.rs | 5 - src/hostname/Cargo.toml | 3 +- src/hostname/main.rs | 5 - src/id/Cargo.toml | 3 +- src/id/main.rs | 5 - src/install/Cargo.toml | 3 +- src/install/main.rs | 5 - src/kill/Cargo.toml | 3 +- src/kill/main.rs | 5 - src/link/Cargo.toml | 3 +- src/link/main.rs | 5 - src/ln/Cargo.toml | 3 +- src/ln/main.rs | 5 - src/logname/Cargo.toml | 3 +- src/logname/main.rs | 5 - src/ls/Cargo.toml | 3 +- src/ls/main.rs | 5 - src/mkdir/Cargo.toml | 3 +- src/mkdir/main.rs | 5 - src/mkfifo/Cargo.toml | 3 +- src/mkfifo/main.rs | 5 - src/mknod/Cargo.toml | 3 +- src/mknod/main.rs | 5 - src/mktemp/Cargo.toml | 3 +- src/mktemp/main.rs | 5 - src/more/Cargo.toml | 3 +- src/more/main.rs | 5 - src/mv/Cargo.toml | 3 +- src/mv/main.rs | 5 - src/nice/Cargo.toml | 3 +- src/nice/main.rs | 5 - src/nl/Cargo.toml | 3 +- src/nl/main.rs | 5 - src/nohup/Cargo.toml | 3 +- src/nohup/main.rs | 5 - src/nproc/Cargo.toml | 3 +- src/nproc/main.rs | 5 - src/numfmt/Cargo.toml | 3 +- src/numfmt/main.rs | 5 - src/od/Cargo.toml | 3 +- src/od/main.rs | 5 - src/paste/Cargo.toml | 3 +- src/paste/main.rs | 5 - src/pathchk/Cargo.toml | 3 +- src/pathchk/main.rs | 5 - src/pinky/Cargo.toml | 3 +- src/pinky/main.rs | 5 - src/printenv/Cargo.toml | 3 +- src/printenv/main.rs | 5 - src/printf/Cargo.toml | 5 +- src/printf/main.rs | 5 - src/ptx/Cargo.toml | 3 +- src/ptx/main.rs | 5 - src/pwd/Cargo.toml | 3 +- src/pwd/main.rs | 5 - src/readlink/Cargo.toml | 3 +- src/readlink/main.rs | 5 - src/realpath/Cargo.toml | 3 +- src/realpath/main.rs | 5 - src/relpath/Cargo.toml | 3 +- src/relpath/main.rs | 5 - src/rm/Cargo.toml | 3 +- src/rm/main.rs | 5 - src/rmdir/Cargo.toml | 3 +- src/rmdir/main.rs | 5 - src/seq/Cargo.toml | 3 +- src/seq/main.rs | 5 - src/shred/Cargo.toml | 3 +- src/shred/main.rs | 5 - src/shuf/Cargo.toml | 3 +- src/shuf/main.rs | 5 - src/sleep/Cargo.toml | 3 +- src/sleep/main.rs | 5 - src/sort/Cargo.toml | 3 +- src/sort/main.rs | 5 - src/split/Cargo.toml | 3 +- src/split/main.rs | 5 - src/stat/Cargo.toml | 3 +- src/stat/main.rs | 5 - src/stdbuf/Cargo.toml | 2 +- src/stdbuf/build.rs | 5 + src/stdbuf/main.rs | 5 - src/sum/Cargo.toml | 3 +- src/sum/main.rs | 5 - src/sync/Cargo.toml | 3 +- src/sync/main.rs | 5 - src/tac/Cargo.toml | 3 +- src/tac/main.rs | 5 - src/tail/Cargo.toml | 3 +- src/tail/main.rs | 5 - src/tee/Cargo.toml | 3 +- src/tee/main.rs | 5 - src/test/Cargo.toml | 3 +- src/test/main.rs | 5 - src/timeout/Cargo.toml | 3 +- src/timeout/main.rs | 5 - src/touch/Cargo.toml | 3 +- src/touch/main.rs | 5 - src/tr/Cargo.toml | 3 +- src/tr/main.rs | 5 - src/true/Cargo.toml | 6 +- src/true/main.rs | 5 - src/truncate/Cargo.toml | 3 +- src/truncate/main.rs | 5 - src/tsort/Cargo.toml | 3 +- src/tsort/main.rs | 5 - src/tty/Cargo.toml | 3 +- src/tty/main.rs | 5 - src/uname/Cargo.toml | 3 +- src/uname/main.rs | 5 - src/unexpand/Cargo.toml | 3 +- src/unexpand/main.rs | 5 - src/uniq/Cargo.toml | 3 +- src/uniq/main.rs | 5 - src/unlink/Cargo.toml | 3 +- src/unlink/main.rs | 5 - src/uptime/Cargo.toml | 3 +- src/uptime/main.rs | 5 - src/users/Cargo.toml | 3 +- src/users/main.rs | 5 - src/uucore/lib.rs | 2 + src/uucore/panic.rs | 13 + src/uutils/uutils.rs | 9 +- src/wc/Cargo.toml | 3 +- src/wc/main.rs | 5 - src/who/Cargo.toml | 3 +- src/who/main.rs | 5 - src/whoami/Cargo.toml | 3 +- src/whoami/main.rs | 5 - src/yes/Cargo.toml | 3 +- src/yes/main.rs | 5 - uumain.rs | 1 + 196 files changed, 288 insertions(+), 1108 deletions(-) create mode 100644 mkmain.rs delete mode 100644 src/arch/main.rs delete mode 100644 src/base32/main.rs delete mode 100644 src/base64/main.rs delete mode 100644 src/basename/main.rs delete mode 100644 src/cat/main.rs delete mode 100644 src/chgrp/main.rs delete mode 100644 src/chmod/main.rs delete mode 100644 src/chown/main.rs delete mode 100644 src/chroot/main.rs rename src/cksum/{gen_table.rs => build.rs} (65%) delete mode 100644 src/cksum/crc_table.rs delete mode 100644 src/cksum/main.rs delete mode 100644 src/comm/main.rs delete mode 100644 src/cp/main.rs delete mode 100644 src/cut/main.rs delete mode 100644 src/date/main.rs delete mode 100644 src/dircolors/main.rs delete mode 100644 src/dirname/main.rs delete mode 100644 src/du/main.rs delete mode 100644 src/echo/main.rs delete mode 100644 src/env/main.rs delete mode 100644 src/expand/main.rs delete mode 100644 src/expr/main.rs rename src/factor/{gen_table.rs => build.rs} (86%) delete mode 100644 src/factor/main.rs delete mode 100644 src/factor/prime_table.rs delete mode 100644 src/false/main.rs delete mode 100644 src/fmt/main.rs delete mode 100644 src/fold/main.rs delete mode 100644 src/groups/main.rs delete mode 100644 src/hashsum/main.rs delete mode 100644 src/head/main.rs delete mode 100644 src/hostid/main.rs delete mode 100644 src/hostname/main.rs delete mode 100644 src/id/main.rs delete mode 100644 src/install/main.rs delete mode 100644 src/kill/main.rs delete mode 100644 src/link/main.rs delete mode 100644 src/ln/main.rs delete mode 100644 src/logname/main.rs delete mode 100644 src/ls/main.rs delete mode 100644 src/mkdir/main.rs delete mode 100644 src/mkfifo/main.rs delete mode 100644 src/mknod/main.rs delete mode 100644 src/mktemp/main.rs delete mode 100644 src/more/main.rs delete mode 100644 src/mv/main.rs delete mode 100644 src/nice/main.rs delete mode 100644 src/nl/main.rs delete mode 100644 src/nohup/main.rs delete mode 100644 src/nproc/main.rs delete mode 100644 src/numfmt/main.rs delete mode 100644 src/od/main.rs delete mode 100644 src/paste/main.rs delete mode 100644 src/pathchk/main.rs delete mode 100644 src/pinky/main.rs delete mode 100644 src/printenv/main.rs delete mode 100644 src/printf/main.rs delete mode 100644 src/ptx/main.rs delete mode 100644 src/pwd/main.rs delete mode 100644 src/readlink/main.rs delete mode 100644 src/realpath/main.rs delete mode 100644 src/relpath/main.rs delete mode 100644 src/rm/main.rs delete mode 100644 src/rmdir/main.rs delete mode 100644 src/seq/main.rs delete mode 100644 src/shred/main.rs delete mode 100644 src/shuf/main.rs delete mode 100644 src/sleep/main.rs delete mode 100644 src/sort/main.rs delete mode 100644 src/split/main.rs delete mode 100644 src/stat/main.rs delete mode 100644 src/stdbuf/main.rs delete mode 100644 src/sum/main.rs delete mode 100644 src/sync/main.rs delete mode 100644 src/tac/main.rs delete mode 100644 src/tail/main.rs delete mode 100644 src/tee/main.rs delete mode 100644 src/test/main.rs delete mode 100644 src/timeout/main.rs delete mode 100644 src/touch/main.rs delete mode 100644 src/tr/main.rs delete mode 100644 src/true/main.rs delete mode 100644 src/truncate/main.rs delete mode 100644 src/tsort/main.rs delete mode 100644 src/tty/main.rs delete mode 100644 src/uname/main.rs delete mode 100644 src/unexpand/main.rs delete mode 100644 src/uniq/main.rs delete mode 100644 src/unlink/main.rs delete mode 100644 src/uptime/main.rs delete mode 100644 src/users/main.rs create mode 100644 src/uucore/panic.rs delete mode 100644 src/wc/main.rs delete mode 100644 src/who/main.rs delete mode 100644 src/whoami/main.rs delete mode 100644 src/yes/main.rs create mode 100644 uumain.rs diff --git a/mkmain.rs b/mkmain.rs new file mode 100644 index 000000000..9270b5390 --- /dev/null +++ b/mkmain.rs @@ -0,0 +1,36 @@ +use std::env; +use std::io::Write; +use std::fs::File; +use std::path::Path; + +static TEMPLATE: &'static str = "\ +extern crate uu_@UTIL_CRATE@; +extern crate uucore; + +use std::io::Write; +use uu_@UTIL_CRATE@::uumain; + +fn main() { + uucore::panic::install_sigpipe_hook(); + + let code = uumain(std::env::args().collect()); + // Since stdout is line-buffered by default, we need to ensure any pending + // writes are flushed before exiting. Ideally, this should be enforced by + // each utility. + // + // See: https://github.com/rust-lang/rust/issues/23818 + // + std::io::stdout().flush().expect(\"could not flush stdout\"); + std::process::exit(code); +} +"; + +pub fn main() { + let out_dir = env::var("OUT_DIR").unwrap(); + let pkgname = env::var("CARGO_PKG_NAME").unwrap(); + + let main = TEMPLATE.replace("@UTIL_CRATE@", &pkgname); + let mut file = File::create(&Path::new(&out_dir).join("main.rs")).unwrap(); + + write!(file, "{}", main).unwrap(); +} diff --git a/src/arch/Cargo.toml b/src/arch/Cargo.toml index a075c65d7..0bfa2ba7e 100644 --- a/src/arch/Cargo.toml +++ b/src/arch/Cargo.toml @@ -2,6 +2,7 @@ name = "arch" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_arch" @@ -14,4 +15,4 @@ features = ["utsname"] [[bin]] name = "arch" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/arch/main.rs b/src/arch/main.rs deleted file mode 100644 index d513afc9a..000000000 --- a/src/arch/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_arch; - -fn main() { - std::process::exit(uu_arch::uumain(std::env::args().collect())); -} diff --git a/src/base32/Cargo.toml b/src/base32/Cargo.toml index 9a561397a..683f3f350 100644 --- a/src/base32/Cargo.toml +++ b/src/base32/Cargo.toml @@ -2,6 +2,7 @@ name = "base32" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_base32" @@ -16,4 +17,4 @@ optional = true [[bin]] name = "base32" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/base32/main.rs b/src/base32/main.rs deleted file mode 100644 index 75bdf4530..000000000 --- a/src/base32/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_base32; - -fn main() { - std::process::exit(uu_base32::uumain(std::env::args().collect())); -} diff --git a/src/base64/Cargo.toml b/src/base64/Cargo.toml index 83e18d0d2..1c6e88171 100644 --- a/src/base64/Cargo.toml +++ b/src/base64/Cargo.toml @@ -2,6 +2,7 @@ name = "base64" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_base64" @@ -12,4 +13,4 @@ uucore = { path="../uucore" } [[bin]] name = "base64" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/base64/main.rs b/src/base64/main.rs deleted file mode 100644 index 3b99e849a..000000000 --- a/src/base64/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_base64; - -fn main() { - std::process::exit(uu_base64::uumain(std::env::args().collect())); -} diff --git a/src/basename/Cargo.toml b/src/basename/Cargo.toml index ed09cbd86..9b0ed2a8b 100644 --- a/src/basename/Cargo.toml +++ b/src/basename/Cargo.toml @@ -2,6 +2,7 @@ name = "basename" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_basename" @@ -12,4 +13,4 @@ uucore = { path="../uucore" } [[bin]] name = "basename" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/basename/main.rs b/src/basename/main.rs deleted file mode 100644 index e7486c808..000000000 --- a/src/basename/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_basename; - -fn main() { - std::process::exit(uu_basename::uumain(std::env::args().collect())); -} diff --git a/src/cat/Cargo.toml b/src/cat/Cargo.toml index 28d9d6ebe..f0d52e9a0 100644 --- a/src/cat/Cargo.toml +++ b/src/cat/Cargo.toml @@ -2,6 +2,7 @@ name = "cat" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_cat" @@ -16,4 +17,4 @@ unix_socket = "0.5.0" [[bin]] name = "cat" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/cat/main.rs b/src/cat/main.rs deleted file mode 100644 index 81245fef5..000000000 --- a/src/cat/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_cat; - -fn main() { - std::process::exit(uu_cat::uumain(std::env::args().collect())); -} diff --git a/src/chgrp/Cargo.toml b/src/chgrp/Cargo.toml index 44adbfa5f..6f338234e 100644 --- a/src/chgrp/Cargo.toml +++ b/src/chgrp/Cargo.toml @@ -2,6 +2,7 @@ name = "chgrp" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_chgrp" @@ -17,4 +18,4 @@ features = ["entries", "fs"] [[bin]] name = "chgrp" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/chgrp/main.rs b/src/chgrp/main.rs deleted file mode 100644 index 55be10cdb..000000000 --- a/src/chgrp/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_chgrp; - -fn main() { - std::process::exit(uu_chgrp::uumain(std::env::args().collect())); -} diff --git a/src/chmod/Cargo.toml b/src/chmod/Cargo.toml index 7e4f9b494..f4b89c8ad 100644 --- a/src/chmod/Cargo.toml +++ b/src/chmod/Cargo.toml @@ -2,6 +2,7 @@ name = "chmod" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_chmod" @@ -14,4 +15,4 @@ walker = "1.0.0" [[bin]] name = "chmod" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/chmod/main.rs b/src/chmod/main.rs deleted file mode 100644 index 1529dfc85..000000000 --- a/src/chmod/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_chmod; - -fn main() { - std::process::exit(uu_chmod::uumain(std::env::args().collect())); -} diff --git a/src/chown/Cargo.toml b/src/chown/Cargo.toml index 8c9fd1d7f..ceff8e315 100644 --- a/src/chown/Cargo.toml +++ b/src/chown/Cargo.toml @@ -2,6 +2,7 @@ name = "chown" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_chown" @@ -22,4 +23,4 @@ optional = true [[bin]] name = "chown" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/chown/main.rs b/src/chown/main.rs deleted file mode 100644 index 50aa0a15f..000000000 --- a/src/chown/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_chown; - -fn main() { - std::process::exit(uu_chown::uumain(std::env::args().collect())); -} diff --git a/src/chroot/Cargo.toml b/src/chroot/Cargo.toml index 8212631c8..450d9e897 100644 --- a/src/chroot/Cargo.toml +++ b/src/chroot/Cargo.toml @@ -2,6 +2,7 @@ name = "chroot" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_chroot" @@ -17,4 +18,4 @@ features = ["entries"] [[bin]] name = "chroot" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/chroot/main.rs b/src/chroot/main.rs deleted file mode 100644 index 61e14f718..000000000 --- a/src/chroot/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_chroot; - -fn main() { - std::process::exit(uu_chroot::uumain(std::env::args().collect())); -} diff --git a/src/cksum/Cargo.toml b/src/cksum/Cargo.toml index e72405ae6..01ff5e9bd 100644 --- a/src/cksum/Cargo.toml +++ b/src/cksum/Cargo.toml @@ -13,4 +13,4 @@ uucore = { path="../uucore" } [[bin]] name = "cksum" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/cksum/gen_table.rs b/src/cksum/build.rs similarity index 65% rename from src/cksum/gen_table.rs rename to src/cksum/build.rs index b8b9b62e4..68efa07a4 100644 --- a/src/cksum/gen_table.rs +++ b/src/cksum/build.rs @@ -8,27 +8,34 @@ * file that was distributed with this source code. */ +use std::env; use std::fs::File; use std::io::Write; +use std::path::Path; static CRC_TABLE_LEN: usize = 256; +#[path = "../../mkmain.rs"] +mod mkmain; + fn main() { + mkmain::main(); + + let out_dir = env::var("OUT_DIR").unwrap(); + let mut table = Vec::with_capacity(CRC_TABLE_LEN); - for num in (0 .. CRC_TABLE_LEN) { + for num in 0..CRC_TABLE_LEN { table.push(crc_entry(num as u8) as u32); } - let file = File::create("crc_table.rs").unwrap_or_else(|e| panic!("{}", e)); - write!(&file, "/* auto-generated (DO NOT EDIT) */ - -pub static CRC_TABLE: [u32; {}] = {:?};", CRC_TABLE_LEN, table).unwrap(); + let file = File::create(&Path::new(&out_dir).join("crc_table.rs")).unwrap(); + write!(&file, "const CRC_TABLE: [u32; {}] = {:?};", CRC_TABLE_LEN, table).unwrap(); } #[inline] fn crc_entry(input: u8) -> u32 { let mut crc = (input as u32) << 24; - for _ in (0 .. 8) { + for _ in 0..8 { if crc & 0x80000000 != 0 { crc <<= 1; crc ^= 0x04c11db7; diff --git a/src/cksum/cksum.rs b/src/cksum/cksum.rs index efb8dad19..10be54b7e 100644 --- a/src/cksum/cksum.rs +++ b/src/cksum/cksum.rs @@ -19,9 +19,7 @@ use std::io::{self, stdin, Read, Write, BufReader}; use std::mem; use std::path::Path; -use crc_table::CRC_TABLE; - -mod crc_table; +include!(concat!(env!("OUT_DIR"), "/crc_table.rs")); static SYNTAX: &'static str = "[OPTIONS] [FILE]..."; static SUMMARY: &'static str = "Print CRC and size for each file"; diff --git a/src/cksum/crc_table.rs b/src/cksum/crc_table.rs deleted file mode 100644 index 592dfe9cb..000000000 --- a/src/cksum/crc_table.rs +++ /dev/null @@ -1,3 +0,0 @@ -/* auto-generated (DO NOT EDIT) */ - -pub static CRC_TABLE: [u32; 256] = [0, 79764919, 159529838, 222504665, 319059676, 398814059, 445009330, 507990021, 638119352, 583659535, 797628118, 726387553, 890018660, 835552979, 1015980042, 944750013, 1276238704, 1221641927, 1167319070, 1095957929, 1595256236, 1540665371, 1452775106, 1381403509, 1780037320, 1859660671, 1671105958, 1733955601, 2031960084, 2111593891, 1889500026, 1952343757, 2552477408, 2632100695, 2443283854, 2506133561, 2334638140, 2414271883, 2191915858, 2254759653, 3190512472, 3135915759, 3081330742, 3009969537, 2905550212, 2850959411, 2762807018, 2691435357, 3560074640, 3505614887, 3719321342, 3648080713, 3342211916, 3287746299, 3467911202, 3396681109, 4063920168, 4143685023, 4223187782, 4286162673, 3779000052, 3858754371, 3904687514, 3967668269, 881225847, 809987520, 1023691545, 969234094, 662832811, 591600412, 771767749, 717299826, 311336399, 374308984, 453813921, 533576470, 25881363, 88864420, 134795389, 214552010, 2023205639, 2086057648, 1897238633, 1976864222, 1804852699, 1867694188, 1645340341, 1724971778, 1587496639, 1516133128, 1461550545, 1406951526, 1302016099, 1230646740, 1142491917, 1087903418, 2896545431, 2825181984, 2770861561, 2716262478, 3215044683, 3143675388, 3055782693, 3001194130, 2326604591, 2389456536, 2200899649, 2280525302, 2578013683, 2640855108, 2418763421, 2498394922, 3769900519, 3832873040, 3912640137, 3992402750, 4088425275, 4151408268, 4197601365, 4277358050, 3334271071, 3263032808, 3476998961, 3422541446, 3585640067, 3514407732, 3694837229, 3640369242, 1762451694, 1842216281, 1619975040, 1682949687, 2047383090, 2127137669, 1938468188, 2001449195, 1325665622, 1271206113, 1183200824, 1111960463, 1543535498, 1489069629, 1434599652, 1363369299, 622672798, 568075817, 748617968, 677256519, 907627842, 853037301, 1067152940, 995781531, 51762726, 131386257, 177728840, 240578815, 269590778, 349224269, 429104020, 491947555, 4046411278, 4126034873, 4172115296, 4234965207, 3794477266, 3874110821, 3953728444, 4016571915, 3609705398, 3555108353, 3735388376, 3664026991, 3290680682, 3236090077, 3449943556, 3378572211, 3174993278, 3120533705, 3032266256, 2961025959, 2923101090, 2868635157, 2813903052, 2742672763, 2604032198, 2683796849, 2461293480, 2524268063, 2284983834, 2364738477, 2175806836, 2238787779, 1569362073, 1498123566, 1409854455, 1355396672, 1317987909, 1246755826, 1192025387, 1137557660, 2072149281, 2135122070, 1912620623, 1992383480, 1753615357, 1816598090, 1627664531, 1707420964, 295390185, 358241886, 404320391, 483945776, 43990325, 106832002, 186451547, 266083308, 932423249, 861060070, 1041341759, 986742920, 613929101, 542559546, 756411363, 701822548, 3316196985, 3244833742, 3425377559, 3370778784, 3601682597, 3530312978, 3744426955, 3689838204, 3819031489, 3881883254, 3928223919, 4007849240, 4037393693, 4100235434, 4180117107, 4259748804, 2310601993, 2373574846, 2151335527, 2231098320, 2596047829, 2659030626, 2470359227, 2550115596, 2947551409, 2876312838, 2788305887, 2733848168, 3165939309, 3094707162, 3040238851, 2985771188]; \ No newline at end of file diff --git a/src/cksum/main.rs b/src/cksum/main.rs deleted file mode 100644 index 1227ff4c1..000000000 --- a/src/cksum/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_cksum; - -fn main() { - std::process::exit(uu_cksum::uumain(std::env::args().collect())); -} diff --git a/src/comm/Cargo.toml b/src/comm/Cargo.toml index 7ce4ba005..46bd0027f 100644 --- a/src/comm/Cargo.toml +++ b/src/comm/Cargo.toml @@ -2,6 +2,7 @@ name = "comm" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_comm" @@ -14,4 +15,4 @@ uucore = { path="../uucore" } [[bin]] name = "comm" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/comm/main.rs b/src/comm/main.rs deleted file mode 100644 index d99a38206..000000000 --- a/src/comm/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_comm; - -fn main() { - std::process::exit(uu_comm::uumain(std::env::args().collect())); -} diff --git a/src/cp/Cargo.toml b/src/cp/Cargo.toml index 0057d9330..3d81eb58a 100644 --- a/src/cp/Cargo.toml +++ b/src/cp/Cargo.toml @@ -5,6 +5,7 @@ authors = [ "Jordy Dickinson ", "Joshua S. Miller ", ] +build = "../../mkmain.rs" [lib] name = "uu_cp" @@ -31,4 +32,4 @@ xattr="0.2.1" [[bin]] name = "cp" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/cp/main.rs b/src/cp/main.rs deleted file mode 100644 index 566ec4c06..000000000 --- a/src/cp/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_cp; - -fn main() { - std::process::exit(uu_cp::uumain(std::env::args().collect())); -} diff --git a/src/cut/Cargo.toml b/src/cut/Cargo.toml index 5297c3b7f..90c9ec5d2 100644 --- a/src/cut/Cargo.toml +++ b/src/cut/Cargo.toml @@ -2,6 +2,7 @@ name = "cut" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_cut" @@ -12,4 +13,4 @@ uucore = { path="../uucore" } [[bin]] name = "cut" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/cut/main.rs b/src/cut/main.rs deleted file mode 100644 index d7b690fdd..000000000 --- a/src/cut/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_cut; - -fn main() { - std::process::exit(uu_cut::uumain(std::env::args().collect())); -} diff --git a/src/date/Cargo.toml b/src/date/Cargo.toml index 613d82895..6940b3d0a 100644 --- a/src/date/Cargo.toml +++ b/src/date/Cargo.toml @@ -2,6 +2,7 @@ name = "date" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_date" @@ -14,4 +15,4 @@ uucore = { path="../uucore" } [[bin]] name = "date" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/date/main.rs b/src/date/main.rs deleted file mode 100644 index 8cf62b61b..000000000 --- a/src/date/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_date; - -fn main() { - std::process::exit(uu_date::uumain(std::env::args().collect())); -} diff --git a/src/dircolors/Cargo.toml b/src/dircolors/Cargo.toml index b4f1869e7..9acc2f8a6 100644 --- a/src/dircolors/Cargo.toml +++ b/src/dircolors/Cargo.toml @@ -2,6 +2,7 @@ name = "dircolors" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_dircolors" @@ -13,4 +14,4 @@ uucore = { path="../uucore" } [[bin]] name = "dircolors" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/dircolors/main.rs b/src/dircolors/main.rs deleted file mode 100644 index ff64af3c5..000000000 --- a/src/dircolors/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_dircolors; - -fn main() { - std::process::exit(uu_dircolors::uumain(std::env::args().collect())); -} diff --git a/src/dirname/Cargo.toml b/src/dirname/Cargo.toml index c2327e3e3..fc7e30e40 100644 --- a/src/dirname/Cargo.toml +++ b/src/dirname/Cargo.toml @@ -2,6 +2,7 @@ name = "dirname" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_dirname" @@ -13,4 +14,4 @@ uucore = { path="../uucore" } [[bin]] name = "dirname" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/dirname/main.rs b/src/dirname/main.rs deleted file mode 100644 index 577d42b98..000000000 --- a/src/dirname/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_dirname; - -fn main() { - std::process::exit(uu_dirname::uumain(std::env::args().collect())); -} diff --git a/src/du/Cargo.toml b/src/du/Cargo.toml index 98ee97066..e4aafe011 100644 --- a/src/du/Cargo.toml +++ b/src/du/Cargo.toml @@ -2,6 +2,7 @@ name = "du" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_du" @@ -13,4 +14,4 @@ uucore = { path="../uucore" } [[bin]] name = "du" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/du/main.rs b/src/du/main.rs deleted file mode 100644 index 10cdbbe0a..000000000 --- a/src/du/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_du; - -fn main() { - std::process::exit(uu_du::uumain(std::env::args().collect())); -} diff --git a/src/echo/Cargo.toml b/src/echo/Cargo.toml index 7abd802d0..a7095a91c 100644 --- a/src/echo/Cargo.toml +++ b/src/echo/Cargo.toml @@ -2,6 +2,7 @@ name = "echo" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_echo" @@ -12,4 +13,4 @@ uucore = { path="../uucore" } [[bin]] name = "echo" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/echo/main.rs b/src/echo/main.rs deleted file mode 100644 index ee009d9b1..000000000 --- a/src/echo/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_echo; - -fn main() { - std::process::exit(uu_echo::uumain(std::env::args().collect())); -} diff --git a/src/env/Cargo.toml b/src/env/Cargo.toml index b9ba01a2d..4db64148e 100644 --- a/src/env/Cargo.toml +++ b/src/env/Cargo.toml @@ -2,6 +2,7 @@ name = "env" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_env" @@ -13,4 +14,4 @@ uucore = { path="../uucore" } [[bin]] name = "env" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/env/main.rs b/src/env/main.rs deleted file mode 100644 index d75e48ef3..000000000 --- a/src/env/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_env; - -fn main() { - std::process::exit(uu_env::uumain(std::env::args().collect())); -} diff --git a/src/expand/Cargo.toml b/src/expand/Cargo.toml index 832e63735..8e64d0f85 100644 --- a/src/expand/Cargo.toml +++ b/src/expand/Cargo.toml @@ -2,6 +2,7 @@ name = "expand" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_expand" @@ -14,4 +15,4 @@ uucore = { path="../uucore" } [[bin]] name = "expand" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/expand/main.rs b/src/expand/main.rs deleted file mode 100644 index e074601b1..000000000 --- a/src/expand/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_expand; - -fn main() { - std::process::exit(uu_expand::uumain(std::env::args().collect())); -} diff --git a/src/expr/Cargo.toml b/src/expr/Cargo.toml index fea7f8ea4..d182e7774 100644 --- a/src/expr/Cargo.toml +++ b/src/expr/Cargo.toml @@ -2,6 +2,7 @@ name = "expr" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_expr" @@ -14,4 +15,4 @@ uucore = { path="../uucore" } [[bin]] name = "expr" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/expr/main.rs b/src/expr/main.rs deleted file mode 100644 index 240305824..000000000 --- a/src/expr/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_expr; - -fn main() { - std::process::exit(uu_expr::uumain(std::env::args().collect())); -} diff --git a/src/factor/Cargo.toml b/src/factor/Cargo.toml index 1077e4ab4..c4149327d 100644 --- a/src/factor/Cargo.toml +++ b/src/factor/Cargo.toml @@ -13,4 +13,4 @@ uucore = { path="../uucore" } [[bin]] name = "factor" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/factor/gen_table.rs b/src/factor/build.rs similarity index 86% rename from src/factor/gen_table.rs rename to src/factor/build.rs index f4ad03cce..16076d2d7 100644 --- a/src/factor/gen_table.rs +++ b/src/factor/build.rs @@ -18,8 +18,11 @@ #![cfg_attr(test, allow(dead_code))] use sieve::Sieve; -use std::env::args; +use std::env::{self, args}; +use std::fs::File; +use std::io::Write; use std::num::Wrapping; +use std::path::Path; use std::u64::MAX as MAX_U64; #[cfg(test)] @@ -30,6 +33,9 @@ mod numeric; mod sieve; +#[path = "../../mkmain.rs"] +mod mkmain; + // extended Euclid algorithm // precondition: a does not divide 2^64 fn inv_mod_u64(a: u64) -> Option { @@ -68,10 +74,15 @@ fn inv_mod_u64(a: u64) -> Option { #[cfg_attr(test, allow(dead_code))] fn main() { + mkmain::main(); + + let out_dir = env::var("OUT_DIR").unwrap(); + let mut file = File::create(&Path::new(&out_dir).join("prime_table.rs")).unwrap(); + // By default, we print the multiplicative inverses mod 2^64 of the first 1k primes let n = args().skip(1).next().unwrap_or("1027".to_string()).parse::().ok().unwrap_or(1027); - print!("{}", PREAMBLE); + write!(file, "{}", PREAMBLE).unwrap(); let mut cols = 3; // we want a total of n + 1 values @@ -85,17 +96,17 @@ fn main() { // format the table let outstr = format!("({}, {}, {}),", x, inv_mod_u64(x).unwrap(), MAX_U64 / x); if cols + outstr.len() > MAX_WIDTH { - print!("\n {}", outstr); + write!(file, "\n {}", outstr).unwrap(); cols = 4 + outstr.len(); } else { - print!(" {}", outstr); + write!(file, " {}", outstr).unwrap(); cols += 1 + outstr.len(); } x = next; } - print!("\n];\n\n#[allow(dead_code)]\npub const NEXT_PRIME: u64 = {};\n", x); + write!(file, "\n];\n\n#[allow(dead_code)]\npub const NEXT_PRIME: u64 = {};\n", x).unwrap(); } #[test] diff --git a/src/factor/factor.rs b/src/factor/factor.rs index 9b1524f71..e91c63048 100644 --- a/src/factor/factor.rs +++ b/src/factor/factor.rs @@ -19,7 +19,6 @@ extern crate rand; extern crate uucore; use numeric::*; -use prime_table::P_INVS_U64; use rand::distributions::{Range, IndependentSample}; use std::cmp::{max, min}; use std::io::{stdin, BufRead, BufReader, Write}; @@ -27,12 +26,13 @@ use std::num::Wrapping; use std::mem::swap; mod numeric; -mod prime_table; -static SYNTAX: &'static str = "[OPTION] [NUMBER]..."; +include!(concat!(env!("OUT_DIR"), "/prime_table.rs")); + +static SYNTAX: &'static str = "[OPTION] [NUMBER]..."; static SUMMARY: &'static str = "Print the prime factors of the given number(s). - If none are specified, read from standard input."; -static LONG_HELP: &'static str = ""; + If none are specified, read from standard input."; +static LONG_HELP: &'static str = ""; fn rho_pollard_pseudorandom_function(x: u64, a: u64, b: u64, num: u64) -> u64 { if num < 1 << 63 { diff --git a/src/factor/main.rs b/src/factor/main.rs deleted file mode 100644 index 023510be8..000000000 --- a/src/factor/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_factor; - -fn main() { - std::process::exit(uu_factor::uumain(std::env::args().collect())); -} diff --git a/src/factor/prime_table.rs b/src/factor/prime_table.rs deleted file mode 100644 index 43f01eb4b..000000000 --- a/src/factor/prime_table.rs +++ /dev/null @@ -1,532 +0,0 @@ -/* -* This file is part of the uutils coreutils package. -* -* (c) kwantam -* -* For the full copyright and license information, please view the LICENSE file -* that was distributed with this source code. -*/ - -// *** NOTE: this file was automatically generated. -// Please do not edit by hand. Instead, modify and -// re-run src/factor/gen_tables.rs. - -pub const P_INVS_U64: &'static [(u64, u64, u64)] = &[ - (3, 12297829382473034411, 6148914691236517205), (5, 14757395258967641293, 3689348814741910323), - (7, 7905747460161236407, 2635249153387078802), (11, 3353953467947191203, 1676976733973595601), - (13, 5675921253449092805, 1418980313362273201), (17, 17361641481138401521, 1085102592571150095), - (19, 9708812670373448219, 970881267037344821), (23, 15238614669586151335, 802032351030850070), - (29, 3816567739388183093, 636094623231363848), (31, 17256631552825064415, 595056260442243600), - (37, 1495681951922396077, 498560650640798692), (41, 10348173504763894809, 449920587163647600), - (43, 9437869060967677571, 428994048225803525), (47, 5887258746928580303, 392483916461905353), - (53, 2436362424829563421, 348051774975651917), (59, 14694863923124558067, 312656679215416129), - (61, 5745707170499696405, 302405640552615600), (67, 17345445920055250027, 275324538413575397), - (71, 1818693077689674103, 259813296812810586), (73, 9097024474706080249, 252695124297391118), - (79, 11208148297950107311, 233503089540627235), (83, 11779246215742243803, 222249928598910260), - (89, 17617676924329347049, 207266787345051141), (97, 11790702397628785569, 190172619316593315), - (101, 4200743699953660269, 182641030432767837), (103, 15760325033848937303, 179094602657374287), - (107, 8619973866219416643, 172399477324388332), (109, 12015769075535579493, 169236184162472950), - (113, 10447713457676206225, 163245522776190722), (127, 9150747060186627967, 145249953336295682), - (131, 281629680514649643, 140814840257324821), (137, 16292379802327414201, 134647766961383588), - (139, 4246732448623781667, 132710389019493177), (149, 16094474695182830269, 123803651501406386), - (151, 8062815290495565607, 122163868037811600), (157, 6579730370240349621, 117495185182863386), - (163, 2263404180823257867, 113170209041162893), (167, 10162278172342986519, 110459545351554201), - (173, 9809829218388894501, 106628578460748853), (179, 17107036403551874683, 103054436165975148), - (181, 3770881385233444253, 101915713114417412), (191, 2124755861893246783, 96579811904238490), - (193, 8124213711219232577, 95578984837873324), (197, 14513935692512591373, 93638294790403815), - (199, 2780916192016515319, 92697206400550510), (211, 13900627050804827995, 87425327363552377), - (223, 7527595115280579359, 82720825442643729), (227, 1950316554048586955, 81263189752024456), - (229, 2094390156840385773, 80553467570784068), (233, 7204522363551799129, 79170575423646144), - (239, 7255204782128442895, 77183029597111094), (241, 17298606475760824337, 76542506529915151), - (251, 2939720171109091891, 73493004277727297), (257, 18374966859414961921, 71777214294589695), - (263, 15430736487513693367, 70139711306880424), (269, 10354863773718001093, 68575256779589411), - (271, 15383631589145234927, 68069166323651481), (277, 17181443938689762877, 66594743948409933), - (281, 14245350405676059433, 65646776063023315), (283, 5149444458738708755, 65182841249857072), - (293, 2707201348701401773, 62958170900032599), (307, 17305088903023944187, 60087114246610917), - (311, 9134400602415662215, 59314289626075728), (313, 6365010734698503433, 58935284580541698), - (317, 17050145153302519317, 58191621683626345), (331, 3455281367280943203, 55730344633563600), - (337, 9196002980365592497, 54738112978366622), (347, 9941040754419844819, 53160645745560667), - (349, 15751088062938241781, 52856000211202153), (353, 8779186981255537313, 52257065364616293), - (359, 5600822016808749655, 51383688227603207), (367, 9751139919072624015, 50263607830271257), - (373, 3511310534137743069, 49455077945602015), (379, 17181268226964305331, 48672147951740241), - (383, 14834457375202459263, 48163822646761231), (389, 12661389891209383757, 47420935922132523), - (397, 185861401246443845, 46465350311610961), (401, 3220129888178724721, 46001855545410353), - (409, 2074694932495450793, 45102063749901104), (419, 1849076971589024267, 44025642180691053), - (421, 14897608040525528621, 43816494236839790), (431, 8046375605237577039, 42799870240625409), - (433, 7540585914657253201, 42602180308798040), (439, 15379290047785184263, 42019918163347497), - (443, 15615189678648040307, 41640505809728107), (449, 205420312624827969, 41084062524965593), - (457, 686202733595322489, 40364866682077793), (461, 3041111821262312197, 40014629227135686), - (463, 8127723090792113455, 39841779856824085), (467, 15247201739725667931, 39500522641776341), - (479, 8010277176057592351, 38510947961815347), (487, 2386334448960373207, 37878324586672590), - (491, 1051952818867347139, 37569743530976683), (499, 12494988971771199291, 36967422993405915), - (503, 17969989256695189447, 36673447462643243), (509, 5436172123882971989, 36241147492553146), - (521, 1805727346946616377, 35406418567580713), (523, 7195288319381928355, 35271021173440825), - (541, 13911777416032342069, 34097493666745936), (547, 13219604528142859659, 33723480939139948), - (557, 5133295029488295333, 33118032448311582), (563, 18151858289227516155, 32765087164670606), - (569, 6386658317259721737, 32419585366800617), (571, 1873749835858413299, 32306031652731263), - (577, 8184343991108570561, 31970093715267853), (587, 8107768264083584867, 31425458387920871), - (593, 13407330009728190129, 31107494222107169), (599, 16999336775772408167, 30795899956109435), - (601, 10926856722530117097, 30693417759916059), (607, 7810235958720518559, 30390023185682951), - (613, 10111102787547160429, 30092567820080834), (617, 5112468778937331161, 29897478239399597), - (619, 10400506755613301315, 29800878955912038), (631, 14909412801254946631, 29234142747558718), - (641, 18417966001831689601, 28778071877862015), (643, 12450835035754191915, 28688559990217032), - (647, 16650538700226241335, 28511196404496988), (653, 18023005695293558853, 28249225227732850), - (659, 13744083976011213723, 27992024391061535), (661, 3544230707051608253, 27907328401981167), - (673, 7016889276180750689, 27409723735081057), (677, 7711120491668837677, 27247775588935822), - (683, 18338710433453565955, 27008410063996415), (691, 16604739238563445883, 26695722248494285), - (701, 4578792394900801685, 26314898821268975), (709, 17796294705807240205, 26017974716092456), - (719, 7799457855921701935, 25656111368163493), (727, 3501582781529460967, 25373788271952615), - (733, 8027982755134170485, 25166090141486427), (739, 12755461734324196043, 24961764646426998), - (743, 8416482154761154775, 24827380987496031), (751, 73688724661955599, 24562908220651866), - (757, 11233750354002778461, 24368222026036395), (761, 8193166224591101769, 24240136759145271), - (769, 8635666926574042369, 23987963684927895), (773, 11955781087876436429, 23863834506739394), - (787, 1757948926973591323, 23439319026314550), (797, 3332912354597459765, 23145224684704581), - (809, 12062209660064712985, 22801908620160137), (811, 2229076349227541379, 22745677032934095), - (821, 4044353146489304861, 22468628591607249), (823, 5536264624794968711, 22414026821032261), - (827, 9502192231439261171, 22305615566758829), (829, 9813044796750195733, 22251802260204525), - (839, 17941052639030982263, 21986584116459537), (853, 13018686907823153661, 21625725760503577), - (857, 12247604875076703465, 21524788884141833), (859, 858986918449804499, 21474672961245112), - (863, 13637338028999645343, 21375137976488472), (877, 4964004106494246501, 21033915705484095), - (881, 14447506709261737361, 20938415520669184), (883, 17047047751015848379, 20890989890950794), - (887, 15763959422628906567, 20796780240935232), (907, 11979197639928253475, 20338196332645591), - (911, 16462352285319281519, 20248895799900715), (919, 16098246732442938407, 20072626848432591), - (929, 13264181960428396641, 19856559821000593), (937, 11792529028977610905, 19687026759561954), - (941, 1725094026021722149, 19603341204792297), (947, 18271431828024877947, 19479138409408185), - (953, 18137040080866579081, 19356499552685783), (967, 9614435380713147895, 19076260676018150), - (971, 10828675717831559651, 18997676697950104), (977, 12064963626510136625, 18881007240234955), - (983, 9326583728009813991, 18765762028188760), (991, 13160290676198438943, 18614272526447579), - (997, 11785933776281829869, 18502250826188115), (1009, 6965519813759503633, 18282204235589248), - (1013, 7775675932353384541, 18210013893099261), (1019, 10372899268140896051, 18102791043875909), - (1021, 7497942008412795221, 18067330140753723), (1031, 13544311604071901623, 17892089305246897), - (1033, 15464550210873641529, 17857448280454551), (1039, 1881958490676816623, 17754325383743553), - (1049, 8370495880920635433, 17585075380085368), (1051, 15691141010367591955, 17551611868420125), - (1061, 10466484384894580653, 17386186685871396), (1063, 5917535022704569239, 17353475139896097), - (1069, 13511506650808773541, 17256074905247475), (1087, 4836542834413267903, 16970325734783396), - (1091, 12613447368457676907, 16908106392034419), (1093, 12235946434985750157, 16877167496532069), - (1097, 14007418243755748857, 16815628143764404), (1103, 13546566364192871087, 16724156005176384), - (1109, 14687533829653321981, 16633673646266502), (1117, 17043007953507839989, 16514542590608372), - (1123, 10923494932339137867, 16426308168931034), (1129, 8610659102608444377, 16339011579902171), - (1151, 2852754513571068799, 16026710750399262), (1153, 16894849732729650049, 15998910731751562), - (1163, 14877941479913636643, 15861344861315177), (1171, 10554499171123313051, 15752983837497482), - (1181, 9918444103984390581, 15619597014148646), (1187, 6884505159775342347, 15540643701524474), - (1193, 17503532515875282841, 15462484554660143), (1201, 10275496907003905105, 15359487155461741), - (1213, 12439766407497455253, 15207538395473661), (1217, 6745111842892974913, 15157554703130280), - (1223, 5399782811437464823, 15083192210719175), (1229, 11572367518982965253, 15009555796346258), - (1231, 1168843247562424879, 14985169840543908), (1237, 12988774525627339901, 14912485104049758), - (1249, 2171073962238033697, 14769210627469616), (1259, 2754557494723904451, 14651901567680342), - (1277, 8710561218830743637, 14445375155606540), (1279, 10802667170608642815, 14422786609624356), - (1283, 17756608675784330667, 14377820790108769), (1289, 715544766241642809, 14310895324832856), - (1291, 10173572254439349923, 14288725076459761), (1297, 9401154844041645041, 14222624574949538), - (1301, 4069343235322552893, 14178896290322483), (1303, 17455744775812645543, 14157132827098658), - (1307, 11545093077501463827, 14113805718216948), (1319, 7286393982109686423, 13985401117293064), - (1321, 10375420777264342809, 13964227156479600), (1327, 17848997280062595535, 13901088224347815), - (1361, 8864195903163884465, 13553816365694012), (1367, 11915490136858474087, 13494326315808011), - (1373, 7241656996161287925, 13435356208091443), (1381, 10365440551193781357, 13357526483497140), - (1399, 11511084757933122631, 13185664098434275), (1409, 11062809611273648769, 13092082380205501), - (1423, 11991031811792927087, 12963277634370731), (1427, 10910337770294927515, 12926940486131430), - (1429, 4001742941112638909, 12908848197137544), (1433, 6539390083352723113, 12872815124710084), - (1439, 3589359513994909279, 12819141121410390), (1447, 15973580044476895767, 12748268191920906), - (1451, 6496406768894266627, 12713124792356686), (1453, 16301183338364118565, 12695625652931556), - (1459, 12921571242858918267, 12643416088903051), (1471, 15612641993044453951, 12540274693208396), - (1481, 7535638193514030201, 12455600319857901), (1483, 10846635760131307491, 12438802477214802), - (1487, 7517637463798243631, 12405342349502052), (1489, 9155234298503263025, 12388679700275051), - (1493, 17211195240909179773, 12355488328003718), (1499, 11419998999601376851, 12306033404742862), - (1511, 5310611298519956951, 12208301835678061), (1523, 3355054568888736571, 12112110356999048), - (1531, 13325995392242171187, 12048820426982071), (1543, 7651274275550300087, 11955116055547343), - (1549, 15826806245293734085, 11908808310980988), (1553, 14028077753413380849, 11878135269613362), - (1559, 9773579605442007463, 11832420829832938), (1567, 5579934072072959455, 11772012810280505), - (1571, 4004035473669609867, 11742039512227594), (1579, 17874299197451307139, 11682548495066213), - (1583, 11163601277709254863, 11653028473600474), (1597, 8663154699613126933, 11550872932817502), - (1601, 13918592655241185729, 11522013787451312), (1607, 1503748272343466871, 11478994445369976), - (1609, 4574425659049167865, 11464725962529242), (1613, 2904818967589724805, 11436295147991042), - (1619, 3999263230310100443, 11393912337065813), (1621, 9707015851248764669, 11379854456329149), - (1627, 10045368930120874451, 11337888182980670), (1637, 13127951646836669293, 11268628023035767), - (1657, 2237655738573095881, 11132615614791521), (1663, 5291098570751326591, 11092449833860223), - (1667, 12747839935760889899, 11065833277570216), (1669, 12312566146262696525, 11052572842246585), - (1693, 14633182097455361973, 10895891360726256), (1697, 3782832609104846177, 10870208646853006), - (1699, 15080946155610692875, 10857412639028576), (1709, 5137887758388383013, 10793881845353745), - (1721, 4062356771607158665, 10718619450150814), (1723, 2141235527998787187, 10706177639993935), - (1733, 18372233278258907149, 10644399350092066), (1741, 3401151549489239557, 10595487693112895), - (1747, 8806287668845887835, 10559097924275644), (1753, 5387754116223211881, 10522957258248460), - (1759, 4184338195230307615, 10487063145940620), (1777, 7816768873102584337, 10380835156842741), - (1783, 6114428349726497479, 10345902453005917), (1787, 17001559870956704819, 10322744305377477), - (1789, 18085851931406681685, 10311204065796283), (1801, 15916846357881534265, 10242500873797641), - (1811, 13751024019606788891, 10185943718227251), (1823, 16463440816196072671, 10118894170987137), - (1831, 11374316799136037015, 10074682727312698), (1847, 10307005892836089479, 9987408810887683), - (1861, 10526836220461872013, 9912275160510237), (1867, 12903828473628641891, 9880419964493600), - (1871, 5176130752911552431, 9859296672212480), (1873, 10567728986166763953, 9848768859428484), - (1877, 8451891264459357693, 9827780540069020), (1879, 13538084128603231335, 9817319890212640), - (1889, 13896091485912489121, 9765348900852065), (1901, 9383483176894863973, 9703705456975040), - (1907, 2843913349591299515, 9673174658473807), (1913, 12053544219622027977, 9642835375697622), - (1931, 10661090826649331747, 9552948769399042), (1933, 6680145293117788997, 9543064704453984), - (1949, 13790100623599187637, 9464722459573910), (1951, 7043989920509285471, 9455020027529242), - (1973, 17128451669050125981, 9349591522407274), (1979, 736378363730699635, 9321245110515185), - (1987, 11864589293508206827, 9283716192103448), (1993, 11727057070441546361, 9255767222132238), - (1997, 13994400236189269253, 9237227878672784), (1999, 2768395808960913199, 9227986029869710), - (2003, 16319336244939253851, 9209557700304319), (2011, 15043590393278798931, 9172920971511462), - (2017, 493864243916864545, 9145634146608602), (2027, 11384744369122175171, 9100515083231155), - (2029, 5309462069515218405, 9091544639580853), (2039, 9698337247188150727, 9046956387302379), - (2053, 11797649765601871053, 8985262578523892), (2063, 3818109413220542191, 8941708227682768), - (2069, 3798121302755084093, 8915777705997849), (2081, 15698790847928695777, 8864365244454373), - (2083, 13345772116697212811, 8855854092035310), (2087, 12993154666196952983, 8838880725304049), - (2089, 7205621428505023513, 8830418417285568), (2099, 9913257415504704251, 8788348772610553), - (2111, 6859637185154901951, 8738391318668664), (2113, 34920480972474305, 8730120243118576), - (2129, 5588609641870672049, 8664511072667708), (2131, 16317274790681607131, 8656379199300587), - (2137, 13327923654566002665, 8632074905806996), (2141, 15749952436590873589, 8615947722423891), - (2143, 11310789413371138975, 8607906707283971), (2153, 15473673849103321049, 8567925719326312), - (2161, 6700922766248032401, 8536207345538894), (2179, 4893170295825663531, 8465692553331597), - (2203, 10433337773872946579, 8373465308084226), (2207, 10364278500860826463, 8358289113597440), - (2213, 8552354007964753709, 8335627688074808), (2221, 17059708386942556965, 8305602914772423), - (2237, 16393440866577822357, 8246197619002928), (2239, 15110017253766555455, 8238831654180237), - (2243, 14104398611864414187, 8224139132282457), (2251, 6883725020842302691, 8194910739097979), - (2267, 13865572078341894995, 8137072815928342), (2269, 4089339915855400821, 8129900429135985), - (2273, 15021963607759076129, 8115593521209657), (2281, 16036779262676914009, 8087130238364555), - (2287, 14583171528319575567, 8065913455928968), (2293, 13072812524979512157, 8044807707679699), - (2297, 4946971854333950281, 8030798464827841), (2309, 9770622781354171341, 7989061963494825), - (2311, 191571552474698935, 7982148019779122), (2333, 13362622153694445877, 7906877014020382), - (2339, 9984428387052711563, 7886594302569282), (2341, 12907204952044530349, 7879856503079688), - (2347, 10532014085543587203, 7859712004137005), (2351, 17214868778272546255, 7846339461382199), - (2357, 1017427547552923933, 7826365750407107), (2371, 18298921156206185323, 7780153552808752), - (2377, 18058718325419489529, 7760514965801241), (2381, 17276874961937127301, 7747477561406783), - (2383, 10241310285152218543, 7740975272223899), (2389, 13551291690816351229, 7721533726960883), - (2393, 2227793162265800425, 7708626859051212), (2399, 3252593890445660831, 7689347258736786), - (2411, 9357265865676806979, 7651075932687495), (2417, 5975920814941902737, 7632082777703579), - (2423, 2047946411815051335, 7613183687044800), (2437, 499583548980234061, 7569447711821728), - (2441, 15590181492856536249, 7557043864690516), (2447, 5435268687022716271, 7538514129019023), - (2459, 7749282890663670931, 7501725934814783), (2467, 14722999222186504715, 7477399300247082), - (2473, 12524093530027633305, 7459257611690073), (2477, 11342103845078581797, 7447211979697033), - (2503, 16596910768675153911, 7369853804917919), (2521, 18227227087509120617, 7317232873347699), - (2531, 6646950057377760203, 7288322431335263), (2539, 3465575786986788547, 7265358043997460), - (2543, 3358569605240866063, 7253930032917637), (2549, 10949362017858984541, 7236855266265026), - (2551, 16769109959597197255, 7231181526346355), (2557, 13101011825520745301, 7214213560308780), - (2579, 13311124746480603163, 7152673157700485), (2591, 17656474451099840991, 7119546149637032), - (2593, 8330558160552983009, 7114054791249345), (2609, 14154994877564784337, 7070427011770621), - (2617, 2283815468048106505, 7048813172987983), (2621, 15624483725156506901, 7038055732052480), - (2633, 11910165182417864697, 7005979519069332), (2647, 13603341304072929639, 6968924848398017), - (2657, 5963776123190253985, 6942696301734870), (2659, 7978095406079723339, 6937474266156281), - (2663, 4419460277516595543, 6927053726515040), (2671, 3549841427887199375, 6906306279936185), - (2677, 15855793094361478621, 6890827072734236), (2683, 3417082297664423091, 6875417097916344), - (2687, 14849388697965671807, 6865182014778396), (2689, 8472193726675826049, 6860075892045203), - (2693, 575390457553509965, 6849886399446547), (2699, 12705630690265304355, 6834658789814580), - (2707, 16695427772659180443, 6814460315371094), (2711, 10390327628386014503, 6804405781523257), - (2713, 8540033378761222569, 6799389632771674), (2719, 7639218031260373343, 6784385462931059), - (2729, 2142769465506019737, 6759525127779242), (2731, 13509149815971843, 6754574907985921), - (2741, 5155128041029374877, 6729932168445659), (2749, 7414933503619154069, 6710347062098781), - (2753, 8831387101034939713, 6700597193501471), (2767, 16100067559815167023, 6666694641745410), - (2777, 11511777990543267177, 6642687819124793), (2789, 14842055826964587245, 6614106874761402), - (2791, 10931893478292941015, 6609367278290774), (2797, 5111271597112943333, 6595189157565088), - (2801, 3839504389493990929, 6585770822459675), (2803, 14017682795933408827, 6581071735180004), - (2819, 9318255963448883115, 6543719075455676), (2833, 8647114765226362353, 6511381600321055), - (2837, 12601265426453687357, 6502200942442563), (2843, 10822781960938280723, 6488478393847890), - (2851, 1067594799074737291, 6470271509543862), (2857, 17813989114233340185, 6456683259961341), - (2861, 1972982763563482277, 6447656090076739), (2879, 12129102650757964991, 6407344242344408), - (2887, 9181839706934750839, 6389589218465379), (2897, 7144372402727689649, 6367533335764429), - (2903, 2923011461903683687, 6354372743268877), (2909, 16893133795930644725, 6341266439913905), - (2917, 9106380344923467373, 6323875239530185), (2927, 5123745449923425167, 6302269926105074), - (2939, 12345949504248617907, 6276537622902195), (2953, 12487315070553807545, 6246780925739773), - (2957, 386776507463642949, 6238330765542628), (2963, 273930725360519835, 6225698303648178), - (2969, 15172431467833858217, 6213116899194864), (2971, 13150523038746829459, 6208934390343167), - (2999, 8051613201895899655, 6150965012907486), (3001, 12760893267917703817, 6146865735991186), - (3011, 3394053874737659115, 6126451037432597), (3019, 6091886002480431587, 6110216652437744), - (3023, 14938018356745280303, 6102131681676993), (3037, 15847071217750484085, 6074001999904363), - (3041, 16426761904506894369, 6066012520128099), (3049, 3817610859465636953, 6050096449232388), - (3061, 17295705812331399261, 6026378331822787), (3067, 4559058365788014387, 6014588873071259), - (3079, 17218558774875365815, 5991147799191150), (3083, 1352242672934920099, 5983374659004071), - (3089, 13579765627586766065, 5971752694629184), (3109, 5684136642847780781, 5933336787941316), - (3119, 3761503440487103183, 5914313585671545), (3121, 4604297863960186065, 5910523573761471), - (3137, 12819222850075493313, 5880377454163070), (3163, 17274503934975558611, 5832040491213895), - (3167, 14584984894401236895, 5824674478594743), (3169, 10111074299789678497, 5820998445474771), - (3181, 3635997653007195493, 5799039318990742), (3187, 11414176125935122619, 5788121767715579), - (3191, 11781405334446902599, 5780866209247744), (3203, 8730959730172863019, 5759208265285529), - (3209, 1965966492118624697, 5748440035434575), (3217, 17322851677549442161, 5734144878367905), - (3221, 10663718554873388733, 5727023928503431), (3229, 5541449907555981749, 5712834956243280), - (3251, 15479150363912536699, 5674175353340372), (3253, 9611814080829292957, 5670686773350615), - (3257, 10279656276875295113, 5663722466597958), (3259, 3792365305119791219, 5660246724059389), - (3271, 2227595203031266551, 5639481526661434), (3299, 7162861218072729803, 5591616875934995), - (3301, 14054396045252808941, 5588229043838095), (3307, 9131333549640924099, 5578090134172830), - (3313, 11926630185899746321, 5567987948599321), (3319, 17407412605862704327, 5557922287951055), - (3323, 9281659973289909811, 5551232041441333), (3329, 4327698144057422593, 5541226816974932), - (3331, 1030049353860695467, 5537899751939222), (3343, 7432774234904805871, 5518020961325022), - (3347, 16142967849386099995, 5511426373979549), (3359, 15481206175584169695, 5491736848380336), - (3361, 18139389813629892321, 5488468929993915), (3371, 2670427501622741379, 5472187503325289), - (3373, 306260796954561189, 5468942802760021), (3389, 6221489665461793301, 5443123066895707), - (3391, 9770083266405884607, 5439912731851828), (3407, 3021216082515388847, 5414365739274890), - (3413, 12685176777320925181, 5404847369970568), (3433, 445988860506231513, 5373359765135319), - (3449, 8824913807370472649, 5348432610527559), (3457, 1371366279127380609, 5336055560806928), - (3461, 4130663581948830541, 5329888492837200), (3463, 3861937468506908727, 5326810301388839), - (3467, 10822231740964876835, 5320664572745760), (3469, 13655589155746938181, 5317597023265941), - (3491, 1976248147684724235, 5284085956376268), (3499, 13986628187353941251, 5272004593800957), - (3511, 2553437089097932807, 5253985780036898), (3517, 14135335592450168213, 5245022483283921), - (3527, 8849416210013201399, 5230151424357684), (3529, 17944934090406599801, 5227187326072414), - (3533, 13136713300156589829, 5221269197200552), (3539, 10956500718546899547, 5212417087795860), - (3541, 16279603284479624061, 5209473051033479), (3547, 10453328330464110163, 5200660860927417), - (3557, 9894964209344341997, 5186039942004372), (3559, 14139566685327242711, 5183125617788578), - (3571, 16742060359253054267, 5165708225625749), (3581, 13120317552565827413, 5151282902460081), - (3583, 10631461488197104127, 5148407500337580), (3593, 16916788678784573497, 5134078506459658), - (3607, 1493332206687881639, 5114151392766717), (3613, 8536660971835696181, 5105658475978287), - (3617, 17268641258938496481, 5100012185156082), (3623, 12876570732103631255, 5091566125782376), - (3631, 2667182770227902671, 5080348133767433), (3637, 15180397308939424797, 5071967026040569), - (3643, 4501552424245893875, 5063613525585932), (3659, 720930418841340771, 5041471460428956), - (3671, 13738326967453531495, 5024991575513361), (3673, 8708590858647525865, 5022255397143901), - (3677, 10826237071271474677, 5016791970005317), (3691, 11394900159322074691, 4997763227772839), - (3697, 419130782307709585, 4989652170329876), (3701, 3982423268007006685, 4984259409270346), - (3709, 10165851951108741845, 4973508782342828), (3719, 3625859079828363063, 4960135540120879), - (3727, 11992610917788635247, 4949488616503770), (3733, 1319389410040302781, 4941533370937463), - (3739, 17015999013165082515, 4933603657049893), (3761, 13002477675991497297, 4904744502448697), - (3767, 783509172230827783, 4896932326442673), (3769, 9925708936450774921, 4894333795094070), - (3779, 10304598237523382763, 4881382395795065), (3793, 9454381882228148785, 4863365165755220), - (3797, 10522951715474029181, 4858241789230853), (3803, 6330002896710745427, 4850576932345398), - (3821, 16868077412599103205, 4827726792386692), (3823, 14620359545733701647, 4825201170209142), - (3833, 3157073861819323209, 4812612594236773), (3847, 15996448721054084791, 4795098537486236), - (3851, 15850500166165906595, 4790117910597131), (3853, 15722581764355610565, 4787631475138736), - (3863, 16379066055610603687, 4775237917087639), (3877, 7550937024755496109, 4757994344521421), - (3881, 4515435936620477721, 4753090459600502), (3889, 6147333586918894033, 4743312952869517), - (3907, 8753586770580370795, 4721459962556834), (3911, 10055857418856753783, 4716631059501291), - (3917, 18117085639918469509, 4709406197015458), (3919, 5671938404904314799, 4707002825646734), - (3923, 15126988448922668251, 4702203434542327), (3929, 10653006440123943145, 4695022670834703), - (3931, 4368842211300837587, 4692633954136238), (3943, 9408166962269822039, 4678352542153069), - (3947, 15553778636256748867, 4673611369067532), (3967, 9128046033953075327, 4650048922034169), - (3989, 3838254595432170429, 4624403127026711), (4001, 9935699444849808481, 4610533385081117), - (4003, 16838471857440594955, 4608229846042855), (4007, 10680420826305505303, 4603629666510993), - (4013, 14433784298890603557, 4596746592003376), (4019, 8147044222651021179, 4589884069099166), - (4021, 13845380157785482909, 4587601112586309), (4027, 1575783452037766515, 4580765848946995), - (4049, 715272615355001137, 4555876530923574), (4051, 9325828650446102619, 4553627270725636), - (4057, 2259805719653351529, 4546892796083202), (4073, 17463944303516825689, 4529031199044819), - (4079, 10862730881355808527, 4522369226209745), (4091, 1848732600885093171, 4509103904597788), - (4093, 7918624318961075541, 4506900579943696), (4099, 5944900932268923563, 4500303506638095), - (4111, 12196120260847132399, 4487167130554500), (4127, 250307164557241311, 4469770795665023), - (4129, 15189859493972505569, 4467605733521325), (4133, 14023631715363031981, 4463281895405166), - (4139, 13931993712108252803, 4456811808096050), (4153, 1159306574341004809, 4441787641153275), - (4157, 4406451013998937877, 4437513609263784), (4159, 7069995204013711295, 4435379676294674), - (4177, 13182554718703138993, 4416266237421487), (4201, 10204768680623898585, 4391036437445739), - (4211, 6965168149417759931, 4380608899004880), (4217, 12773178253552736713, 4374376114230389), - (4219, 7913867450441879219, 4372302458807668), (4229, 14778332684258207821, 4361963602201360), - (4231, 248514396644160823, 4359901695511593), (4241, 13549070452630335601, 4349621333107651), - (4243, 12334059141436247451, 4347571075585564), (4253, 17570599633810814389, 4337348712369986), - (4259, 15835007357004489483, 4331238336160965), (4261, 15078622297284761389, 4329205368155257), - (4271, 15401800366857471567, 4319069087733446), (4273, 14306695497372678225, 4317047524855968), - (4283, 11396237408133428339, 4306968030284742), (4289, 6829897316169449281, 4300942894313255), - (4297, 10826783466114845049, 4292935553574482), (4327, 3465958616114135767, 4263171729537682), - (4337, 4249088616471257105, 4253341958429686), (4339, 3804986389944698939, 4251381441278993), - (4349, 8788607431760448597, 4241605903359289), (4357, 1752800561513829325, 4233817781434370), - (4363, 4879106729557832355, 4227995432892402), (4373, 14042810661188908605, 4218327023487205), - (4391, 17963625064719208087, 4201034860785595), (4397, 15606524438071305893, 4195302268298738), - (4409, 3782231037113502985, 4183883890612282), (4421, 1969432979595319693, 4172527499142626), - (4423, 1259533508989438071, 4170640758243172), (4441, 1013511721230608105, 4153736562420525), - (4447, 10581885345633700511, 4148132240546334), (4451, 14928144721074321483, 4144404420065053), - (4457, 15160516836885368537, 4138825235294940), (4463, 8303721452852899215, 4133261051693827), - (4481, 14552385695283031681, 4116657905313446), (4483, 8295479824358343979, 4114821341447591), - (4493, 15778063092647631173, 4105663047787569), (4507, 8402743639522012307, 4092909712382860), - (4513, 662169851526910561, 4087468219301917), (4517, 3695882972483317293, 4083848588379356), - (4519, 2249204687898641943, 4082041175859604), (4523, 3597176270840553731, 4078431146077725), - (4547, 4819602366300186347, 4056904348737530), (4549, 1184095245003998477, 4055120702068487), - (4561, 12804733991967647537, 4044451671499572), (4567, 8667990536934683111, 4039138181237037), - (4583, 4512066355362951639, 4025036891492374), (4591, 9422264180537769231, 4018023104706937), - (4597, 13996572401370223197, 4012778784796508), (4603, 5570491910157783347, 4007548136804160), - (4621, 14482749945773264069, 3991937691778738), (4637, 16867413170698403893, 3978163483655283), - (4639, 13106373888110946783, 3976448388383175), (4643, 1326989558608440715, 3973022630564193), - (4649, 5773287293449644569, 3967895047044429), (4651, 16011504155142003843, 3966188792455289), - (4657, 2150865800305837777, 3961078821926036), (4663, 636913102266188679, 3955982001653345), - (4673, 5542313006524333505, 3947516386413342), (4679, 13912921529412482935, 3942454386345277), - (4691, 2355489170784911835, 3932369233363792), (4703, 18325151671777806751, 3922335546185318), - (4721, 2961794536723541649, 3907380655308102), (4723, 13908290418479719099, 3905726037202953), - (4729, 3237639581556127689, 3900770580188105), (4733, 18244075429755844309, 3897473922186678), - (4751, 1615206384900689007, 3882707656011271), (4759, 17136594988415618343, 3876180725721696), - (4783, 3089241480878392399, 3856730937426207), (4787, 11117371350042209403, 3853508266912377), - (4789, 7965727029532543901, 3851898950450939), (4793, 16872632175911261065, 3848684346695086), - (4799, 7976035414241991999, 3843872488791321), (4801, 15891633719821434177, 3842271208854311), - (4813, 13560062441883314693, 3832691475942146), (4817, 4702636853335131697, 3829508838220791), - (4831, 8923626764698659103, 3818411110269002), (4861, 4770120818895886933, 3794845520203569), - (4871, 11845907506171931319, 3787054829338852), (4877, 9005884281218462661, 3782395750196750), - (4889, 14832102874565810473, 3773111898897433), (4903, 17190123123144797335, 3762338175343575), - (4909, 5264593287281947813, 3757739676860776), (4919, 7211443149775049351, 3750100441900701), - (4931, 13205639136117363051, 3740974259523332), (4933, 8869993298771347341, 3739457545856385), - (4937, 15565958235988250361, 3736427805085993), (4943, 8564693030379004847, 3731892387964707), - (4951, 3968043312159295591, 3725862264938305), (4957, 9638302834558753013, 3721352445775580), - (4967, 16541533743568017495, 3713860292673555), (4969, 10357499691215465689, 3712365480722389), - (4973, 5515847262740016741, 3709379463846682), (4987, 7294361201795716019, 3698966126671255), - (4993, 964270018673781889, 3694521144343991), (4999, 13125638861809336887, 3690086832108331), - (5003, 9487002298951564323, 3687136532822216), (5009, 2938810495272553841, 3682719918887912), - (5011, 17154625301035025051, 3681250064599790), (5021, 14901412858587122357, 3673918357639823), - (5023, 8751461502617929823, 3672455519352887), (5039, 7526593731999769423, 3660794616731405), - (5051, 3031240859469199731, 3652097421047228), (5059, 14629044717082965227, 3646322212632842), - (5077, 14050336681708653949, 3633394538843717), (5081, 10953321564727753833, 3630534161328390), - (5087, 4587208817228736543, 3626252029429831), (5099, 15849222550876945603, 3617717998374103), - (5101, 7395332607476187621, 3616299563558037), (5107, 10818092520219327803, 3612050924948022), - (5113, 14341053724427042377, 3607812257717494), (5119, 4551325994353421311, 3603583526803975), - (5147, 12293050742728533523, 3583979808375665), (5153, 2233799398795800545, 3579806728839423), - (5167, 11445763789493482191, 3570107233154548), (5171, 5586463202364950267, 3567345595379917), - (5179, 3344563175364601075, 3561835117534186), (5189, 16850562133240176269, 3554970914185691), - (5197, 4678239116634440837, 3549498571042823), (5209, 4228337958151123945, 3541321572990891), - (5227, 12210777596142155843, 3529126472873455), (5231, 818131260772436623, 3526427848157054), - (5233, 5062014999015271569, 3525080082879715), (5237, 16544654747797167069, 3522387640578489), - (5261, 7296649765707959877, 3506318964780374), (5273, 10047230984201371561, 3498339479178750), - (5279, 6384201822820108127, 3494363340350360), (5281, 2997028292982919009, 3493039968511560), - (5297, 8566922866023314513, 3482488969928176), (5303, 12933244289280051463, 3478548759892429), - (5309, 6038885138464343701, 3474617455963373), (5323, 4168971091616116963, 3465478879148891), - (5333, 15983949815228171389, 3458980700114298), (5347, 6623854240045322443, 3449924083356938), - (5351, 13155069217954709207, 3447345182902177), (5381, 15004905930240978893, 3428125640904952), - (5387, 14803280978401037987, 3424307420402738), (5393, 17827633990761020401, 3420497695848238), - (5399, 7250229843380564647, 3416696438916382), (5407, 17075264303479989983, 3411641219476521), - (5413, 8267467416002100909, 3407859610882976), (5417, 6194319267136362265, 3405343192488379), - (5419, 9225074080042975619, 3404086376399621), (5431, 9948538647007047815, 3396564918746004), - (5437, 11023261264572803605, 3392816640373285), (5441, 6736570570568071873, 3390322380758969), - (5443, 1633534933589565291, 3389076625704492), (5449, 8693565568230157561, 3385344847441650), - (5471, 7279568717810075295, 3371731689583175), (5477, 14122183293968258157, 3368037990452720), - (5479, 17918155130549778007, 3366808555157793), (5483, 9891195983349641027, 3364352375288993), - (5501, 10026497869549456341, 3353343769080085), (5503, 305043378285947519, 3352125036109313), - (5507, 2599359615253061931, 3349690225841574), (5519, 8001722288903907695, 3342406971137806), - (5521, 12486050100244990833, 3341196173466682), (5527, 15569759562846943783, 3337569038123674), - (5531, 2498031334516082835, 3335155319781151), (5557, 15827618453022699677, 3319550850046707), - (5563, 1369495830027331443, 3315970532753829), (5569, 14359245027748411969, 3312397930276450), - (5573, 15080453256741560589, 3310020468995074), (5581, 13835884374224723717, 3305275770240019), - (5591, 16546310414890610151, 3299363991005106), (5623, 13912972010777557959, 3280587599806073), - (5639, 843990064021469111, 3271279317912670), (5641, 4133431042221037625, 3270119495428036), - (5647, 7993480210442229999, 3266644957271038), (5651, 5957407172981761051, 3264332697524252), - (5653, 3899497464723671357, 3263177794747842), (5657, 3759783616225404457, 3260870439050654), - (5659, 6816070305376687123, 3259717984398224), (5669, 14714442882574456237, 3253967908574625), - (5683, 2054687488766170363, 3245951798998689), (5689, 17999275154361350153, 3242528401073923), - (5693, 14694534406160691477, 3240250144688134), (5701, 11150233306087197837, 3235703222892396), - (5711, 16615312820024852655, 3230037484452731), (5717, 10486604554758797053, 3226647555310399), - (5737, 2205763715280591321, 3215399001866751), (5741, 2609084861148259173, 3213158695995393), - (5743, 346900289040681103, 3212039713339639), (5749, 2717758258902763997, 3208687436721090), - (5779, 4197520065223751579, 3192030467850761), (5783, 10344594679412082983, 3189822596180105), - (5791, 8043175407721743711, 3185416003058116), (5801, 10566890287353359769, 3179924853251086), - (5807, 10819633255563067471, 3176639241210530), (5813, 13007604327909074845, 3173360411785575), - (5821, 1191543681792611477, 3168999153703753), (5827, 819925641855289835, 3165736068939342), - (5839, 14295515830370906159, 3159230017761526), (5843, 14490938781161533787, 3157067272584212), - (5849, 649688712460962153, 3153828701266806), (5851, 1588986329370981715, 3152750653513852), - (5857, 16739703730880359713, 3149520927729136), (5861, 13656444725443737325, 3147371450897381), - (5867, 5499123126797001155, 3144152731158948), (5869, 2618186712114509541, 3143081287052232), - (5879, 15525512787330304711, 3137735001481468), (5881, 9798950601303968585, 3136667926153639), - (5897, 6043600059421206329, 3128157380652798), (5903, 9878054890224613359, 3124977820381086), - (5923, 2229928880090501259, 3114425810182264), (5927, 13031300394233489559, 3112323953721874), - (5939, 8684474899830258683, 3106035371899234), (5953, 167331459764877505, 3098730736386620), - (5981, 1761091935477036277, 3084224055126158), (5987, 4159529731001819723, 3081133134075422), - (6007, 5008596568040665671, 3070874658516655), (6011, 1224463630911680435, 3068831155167118), - (6029, 6296798690279359301, 3059668945713974), (6037, 9414347936243022781, 3055614390211951), - (6043, 12027167243159959187, 3052580518568517), (6047, 9465891658792911967, 3050561282240706), - (6053, 5250906994713622573, 3047537431638782), (6067, 12578569347772608379, 3040505039345566), - (6073, 2019938219828231817, 3037501082448468), (6079, 12930017519012403263, 3034503055388970), - (6089, 13023904216271532665, 3029519473429060), (6091, 3534288349042693603, 3028524720687826), - (6101, 4934451127404358013, 3023560739831101), (6113, 14047046239672495137, 3017625400574112), - (6121, 12365134934558126169, 3013681436645899), (6131, 13226535140764506427, 3008765955587922), - (6133, 12392073305671507037, 3007784782929977), (6143, 9690321199065720831, 3002888502964276), - (6151, 17867940365983012279, 2998982941588286), (6163, 5827650610337903131, 2993143610856652), - (6173, 16486422655865154101, 2988294844274996), (6197, 10207178542641609245, 2976721651397378), - (6199, 14244969169357577607, 2975761263705364), (6203, 16347211377266065651, 2973842346237232), - (6211, 13388813763368645739, 2970011926213097), (6217, 2222392039763302905, 2967145580458348), - (6221, 5610229832415764613, 2965237754976619), (6229, 9361078506501186813, 2961429454761526), - (6247, 17153375432076002135, 2952896442085729), (6257, 17739181571281823889, 2948177093448865), - (6263, 3572712847103574343, 2945352718139797), (6269, 15030462390893027541, 2942533749195972), - (6271, 15458083257430026111, 2941595291613706), (6277, 13198076730130571341, 2938783507043102), - (6287, 11343265880222860911, 2934109125768975), (6299, 12282210612023790995, 2928519459233140), - (6301, 3940536029711642037, 2927589918062141), (6311, 14059394548335120151, 2922951049549921), - (6317, 17115144374863334181, 2920174778171529), (6323, 9411544580387001979, 2917403775693429), - (6329, 17248827844558876041, 2914638027130597), (6337, 14927395235913299777, 2910958509343467), - (6343, 6293355537680509175, 2908204961959569), (6353, 3205604510841389105, 2903627274312852), - (6359, 12865436384164469479, 2900887572528628), (6361, 17086655570240005993, 2899975487141888), - (6367, 14680328603971461919, 2897242669029299), (6373, 10177114728254006509, 2894514996659273), - (6379, 9323138876569931715, 2891792455511765), (6389, 11153509525237125981, 2887266250384966), - (6397, 15969684020666483797, 2883655475021033), (6421, 14505156646653095485, 2872877133423072), - (6427, 10054293525782567187, 2870195125830022), (6449, 12242528242437103569, 2860403794961940), - (6451, 8564253371688126971, 2859516985538606), (6469, 15991550589791801741, 2851560376211091), - (6473, 5639750737196230905, 2849798250225483), (6481, 5610018912094048177, 2846280523639801), - (6491, 9128168535627034323, 2841895559037059), (6521, 8557184607111086281, 2828821357722673), - (6529, 14697497728815605377, 2825355195850750), (6547, 518436063779220635, 2817587303147938), - (6551, 13597821268805285415, 2815866901802709), (6553, 17436156385252092585, 2815007488739440), - (6563, 17465803393879499275, 2810718280315336), (6569, 10626043473118730905, 2808151023551461), - (6571, 18101446627192084739, 2807296313150137), (6577, 7505471665082371921, 2804735300852904), - (6581, 1345454665762131101, 2803030553671106), (6599, 7161775771608406007, 2795384766435755), - (6607, 3696608014770916655, 2792000011156281), (6619, 15353242650259241555, 2786938219324603), - (6637, 8357595213145189349, 2779379851395141), (6653, 1186713732684155733, 2772695637112513), - (6659, 12391092692852203691, 2770197337995127), (6661, 4536220806596043469, 2769365571792456), - (6673, 10526779774117484273, 2764385444883793), (6679, 13467034601498394023, 2761902092185888), - (6689, 17961376013166438881, 2757773071267685), (6691, 8973868175149393291, 2756948748125773), - (6701, 16605097784303240613, 2752834513312871), (6703, 14324228390818770127, 2752013139446449), - (6709, 9246743228481923101, 2749551956134975), (6719, 4530008590805292479, 2745459752003207), - (6733, 3843870776090078853, 2739751087733484), (6737, 5292794462591741617, 2738124398650668), - (6761, 3486901187132200409, 2728404684766979), (6763, 8150062293692760643, 2727597822521004), - (6779, 5891311538513228979, 2721160063978396), (6781, 6999479796734209749, 2720357480269805), - (6791, 11036536765054028599, 2716351652732962), (6793, 12073343758532705209, 2715551902503982), - (6803, 4238168600206971803, 2711560204866904), (6823, 627237963520535831, 2703611911726447), - (6827, 1680661317393780739, 2702027841469100), (6829, 6950281520230586661, 2701236502227200), - (6833, 3018214528670756433, 2699655213480104), (6841, 9284043245984795529, 2696498183556432), - (6857, 14225810509227958137, 2690206223378963), (6863, 14941782064075680815, 2687854301866465), - (6869, 9963229074605100669, 2685506489111886), (6871, 15958004187764455655, 2684724796057277), - (6883, 2355758832019569355, 2680044177496665), (6899, 17246194995713379899, 2673828681505950), - (6907, 17672231871396569139, 2670731732113732), (6911, 16193951135175206143, 2669185946130741), - (6917, 370695016082930125, 2666870619301655), (6947, 6718045560167722123, 2655353976350878), - (6949, 5802933162344089773, 2654589735747525), (6959, 7962928466363485135, 2650775121958550), - (6961, 12534563923092397521, 2650013514395855), (6967, 977012855346465415, 2647731315302074), - (6971, 3191331710356293107, 2646212031804554), (6977, 14766384642635494593, 2643936372898029), - (6983, 2826581148341575287, 2641664624618294), (6991, 16045580133346843567, 2638641692706272), - (6997, 9506782782592059901, 2636379030114270), (7001, 5401489123140205801, 2634872742995222), - (7013, 5523764801766727277, 2630364191317489), (7019, 1952689962496964931, 2628115696496588), - (7027, 4502087104939786683, 2625123676349729), (7039, 9670192588718318719, 2620648398026644), - (7043, 12207904888195402539, 2619160027503840), (7057, 13242341714242962801, 2613964017813454), - (7069, 10281535104033899189, 2609526676150735), (7079, 16080641005630970903, 2605840383346454), - (7103, 17083300368416363583, 2597035629129881), (7109, 12639483806870055693, 2594843729597629), - (7121, 11885081001289063729, 2590471011614878), (7127, 16831651004817344487, 2588290174506742), - (7129, 16953719619995087977, 2587564044565794), (7151, 7261583634106053391, 2579603422417780), - (7159, 5158595004269663687, 2576720781353478), (7177, 17238722656035942969, 2570258335475763), - (7187, 10628630472969424411, 2566682075095248), (7193, 9324671409983029289, 2564541091854518), - (7207, 6974799167595189143, 2559559327557867), (7211, 12552790621230449283, 2558139519305165), - (7213, 5431981756905460645, 2557430205699369), (7219, 9740821223019921147, 2555304623037754), - (7229, 13549897777202617109, 2551769826215182), (7237, 779978400795235981, 2548949022206653), - (7243, 1319261829377543523, 2546837508450856), (7247, 6600304592676813487, 2545431775039264), - (7253, 4702609925863637245, 2543326082132848), (7283, 11559925848195852475, 2532849659990327), - (7297, 1266523061659378561, 2527990143032691), (7307, 7389300657417251619, 2524530460340707), - (7309, 9509827838245668421, 2523839659831652), (7321, 7339894206626953129, 2519702782913475), - (7331, 7936302115465819915, 2516265730965700), (7333, 4512949525192272685, 2515579445480642), - (7349, 8313459841083961757, 2510102609022935), (7351, 7613579311608594695, 2509419680820235), - (7369, 10356110765766917497, 2503290008645616), (7393, 13329163646930396961, 2495163543042006), - (7411, 12017390418009676859, 2489103234881871), (7417, 16529197939041887561, 2487089668829655), - (7433, 16411720511158518073, 2481736051891504), (7451, 4867306247337669907, 2475740715838082), - (7457, 13959363927577175777, 2473748702388299), (7459, 7204097799532903051, 2473085410069654), - (7477, 16714817587184995613, 2467131747185977), (7481, 8879391178910318857, 2465812601752379), - (7487, 8327767459481539263, 2463836526473828), (7489, 2943498353329271489, 2463178538350854), - (7499, 7741285984793166947, 2459893862342919), (7507, 6275873766385266395, 2457272422233855), - (7517, 15651634122937278197, 2454003468632373), (7523, 10828236319221238859, 2452046267939592), - (7529, 4687026353168597721, 2450092186706010), (7537, 14956621073960338321, 2447491584676867), - (7541, 1223096676416228061, 2446193352832456), (7547, 11989039311189260723, 2444248585359686), - (7549, 8528167547654833109, 2443601016520009), (7559, 8011729169729919031, 2440368312436770), - (7561, 7380161463162464441, 2439722797739657), (7573, 10532645104281011645, 2435856869630206), - (7577, 8104686686205503145, 2434570948094173), (7583, 11637771811766648415, 2432644609482995), - (7589, 3417594171516092973, 2430721316867775), (7591, 14242704125413210647, 2430080894968983), - (7603, 2938183226787092859, 2426245439130547), (7607, 6697766153751252999, 2424969642922249), - (7621, 10459044894698723597, 2420514902730553), (7639, 12602900552518673895, 2414811372392924), - (7643, 8312257829367486035, 2413547569502754), (7649, 8303325904795657761, 2411654343536351), - (7669, 1820861294014621277, 2405364985488271), (7673, 17468270877045953609, 2404111048313508), - (7681, 13079152223072805377, 2401607092007492), (7687, 12399418060212989879, 2399732545038318), - (7691, 16966879154521046435, 2398484471942471), (7699, 12504683377151597595, 2395992216354013), - (7703, 16902131594475141543, 2394748029820790), (7717, 12155201971596873133, 2390403534237339), - (7723, 5099546626617880707, 2388546429329218), (7727, 11158286760776296655, 2387309961655176), - (7741, 15213023403508820245, 2382992387767672), (7753, 6999912429363278841, 2379304020857674), - (7757, 9407673012194790021, 2378077101161473), (7759, 4426838183431780527, 2377464115699130), - (7789, 8521168978971237221, 2368307109219354), (7793, 10912291823405752977, 2367091501823373), - (7817, 15223224513176451001, 2359823982820717), (7823, 5647443698905071727, 2358014070524038), - (7829, 13225389511525317821, 2356206932393607), (7841, 3761808924099167585, 2352600953157703), - (7853, 14765851680547337509, 2349005994360060), (7867, 16228538926419703411, 2344825737092862), - (7873, 17809437533883691329, 2343038749359780), (7877, 3187256402731839501, 2341848936614136), - (7879, 15749618908978823927, 2341254483273201), (7883, 13069271299209418467, 2340066481505715), - (7901, 7641588830939294069, 2334735359284843), (7907, 12420698804657854155, 2332963712369995), - (7919, 12818844884155027471, 2329428472497733), (7927, 7937661667140567751, 2327077592242910), - (7933, 17988656517612138069, 2325317543641693), (7937, 12066964247284867329, 2324145656256715), - (7949, 10178314191381317573, 2320637070538376), (7951, 5681810619609444335, 2320053335896057), - (7963, 6180574304741565203, 2316557085735219), (7993, 7117447607071219465, 2307862388803897), - (8009, 15818733711853814521, 2303251850881452), (8011, 6594866437037093475, 2302676828574404), - (8017, 12876135691215997361, 2300953483062186), (8039, 16092426444697734231, 2294656558491050), - (8053, 7540876877021214941, 2290667338098789), (8059, 6493784953110063027, 2288961915089905), - (8069, 14763796409470353741, 2286125179540160), (8081, 12739918163021037937, 2282730364275405), - (8087, 10456272391972868135, 2281036734723575), (8089, 11422888004105716905, 2280472749871374), - (8093, 18241602968231501493, 2279345616422779), (8101, 4561020661602299949, 2277094688767997), - (8111, 16802434375116035919, 2274287273296702), (8117, 16051417197561976477, 2272606144352538), - (8123, 11545395404498259315, 2270927498917832), (8147, 11443457045357563995, 2264237642532165), - (8161, 12755174219819017249, 2260353397097114), (8167, 10672323466178233303, 2258692797074758), - (8171, 17536936478347301059, 2257587085266130), (8179, 16031233265182478651, 2255378906187743), - (8191, 18442239924259250175, 2252074725150720), -]; - -#[allow(dead_code)] -pub const NEXT_PRIME: u64 = 8209; diff --git a/src/false/Cargo.toml b/src/false/Cargo.toml index 9b4582065..89420e51d 100644 --- a/src/false/Cargo.toml +++ b/src/false/Cargo.toml @@ -2,11 +2,15 @@ name = "false" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_false" path = "false.rs" +[dependencies] +uucore = { path = "../uucore" } + [[bin]] name = "false" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/false/main.rs b/src/false/main.rs deleted file mode 100644 index 09a95fe39..000000000 --- a/src/false/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_false; - -fn main() { - std::process::exit(uu_false::uumain(std::env::args().collect())); -} diff --git a/src/fmt/Cargo.toml b/src/fmt/Cargo.toml index 0fe85b4b1..32e5bef1c 100644 --- a/src/fmt/Cargo.toml +++ b/src/fmt/Cargo.toml @@ -2,6 +2,7 @@ name = "fmt" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_fmt" @@ -14,4 +15,4 @@ uucore = { path="../uucore" } [[bin]] name = "fmt" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/fmt/main.rs b/src/fmt/main.rs deleted file mode 100644 index ac1b5d125..000000000 --- a/src/fmt/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_fmt; - -fn main() { - std::process::exit(uu_fmt::uumain(std::env::args().collect())); -} diff --git a/src/fold/Cargo.toml b/src/fold/Cargo.toml index e54a6c427..1804bce08 100644 --- a/src/fold/Cargo.toml +++ b/src/fold/Cargo.toml @@ -2,6 +2,7 @@ name = "fold" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_fold" @@ -12,4 +13,4 @@ uucore = { path="../uucore" } [[bin]] name = "fold" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/fold/main.rs b/src/fold/main.rs deleted file mode 100644 index 56c0a56d5..000000000 --- a/src/fold/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_fold; - -fn main() { - std::process::exit(uu_fold::uumain(std::env::args().collect())); -} diff --git a/src/groups/Cargo.toml b/src/groups/Cargo.toml index c5132f620..0d0ff38f8 100644 --- a/src/groups/Cargo.toml +++ b/src/groups/Cargo.toml @@ -2,6 +2,7 @@ name = "groups" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_groups" @@ -14,4 +15,4 @@ features = ["entries"] [[bin]] name = "groups" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/groups/main.rs b/src/groups/main.rs deleted file mode 100644 index 5ddd248c9..000000000 --- a/src/groups/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_groups; - -fn main() { - std::process::exit(uu_groups::uumain(std::env::args().collect())); -} diff --git a/src/hashsum/Cargo.toml b/src/hashsum/Cargo.toml index 8ad85c317..5b074bcea 100644 --- a/src/hashsum/Cargo.toml +++ b/src/hashsum/Cargo.toml @@ -2,6 +2,7 @@ name = "hashsum" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_hashsum" @@ -22,4 +23,4 @@ uucore = { path="../uucore" } [[bin]] name = "hashsum" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/hashsum/main.rs b/src/hashsum/main.rs deleted file mode 100644 index 7c0126164..000000000 --- a/src/hashsum/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_hashsum; - -fn main() { - std::process::exit(uu_hashsum::uumain(std::env::args().collect())); -} diff --git a/src/head/Cargo.toml b/src/head/Cargo.toml index 3b9841ce9..2866f4296 100644 --- a/src/head/Cargo.toml +++ b/src/head/Cargo.toml @@ -2,6 +2,7 @@ name = "head" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_head" @@ -13,4 +14,4 @@ uucore = { path="../uucore" } [[bin]] name = "head" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/head/main.rs b/src/head/main.rs deleted file mode 100644 index d0d2aa15b..000000000 --- a/src/head/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_head; - -fn main() { - std::process::exit(uu_head::uumain(std::env::args().collect())); -} diff --git a/src/hostid/Cargo.toml b/src/hostid/Cargo.toml index e7f14ecef..c6e4c5229 100644 --- a/src/hostid/Cargo.toml +++ b/src/hostid/Cargo.toml @@ -2,6 +2,7 @@ name = "hostid" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_hostid" @@ -13,4 +14,4 @@ uucore = { path="../uucore" } [[bin]] name = "hostid" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/hostid/main.rs b/src/hostid/main.rs deleted file mode 100644 index 72e4104e2..000000000 --- a/src/hostid/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_hostid; - -fn main() { - std::process::exit(uu_hostid::uumain(std::env::args().collect())); -} diff --git a/src/hostname/Cargo.toml b/src/hostname/Cargo.toml index 820bec64b..57d40154c 100644 --- a/src/hostname/Cargo.toml +++ b/src/hostname/Cargo.toml @@ -2,6 +2,7 @@ name = "hostname" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_hostname" @@ -13,4 +14,4 @@ uucore = { path="../uucore" } [[bin]] name = "hostname" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/hostname/main.rs b/src/hostname/main.rs deleted file mode 100644 index 5fb75dbbb..000000000 --- a/src/hostname/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_hostname; - -fn main() { - std::process::exit(uu_hostname::uumain(std::env::args().collect())); -} diff --git a/src/id/Cargo.toml b/src/id/Cargo.toml index f11481c6b..1e2f863b7 100644 --- a/src/id/Cargo.toml +++ b/src/id/Cargo.toml @@ -2,6 +2,7 @@ name = "id" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_id" @@ -14,4 +15,4 @@ features = ["entries", "process"] [[bin]] name = "id" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/id/main.rs b/src/id/main.rs deleted file mode 100644 index 8a62d84fb..000000000 --- a/src/id/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_id; - -fn main() { - std::process::exit(uu_id::uumain(std::env::args().collect())); -} diff --git a/src/install/Cargo.toml b/src/install/Cargo.toml index 03356137b..4c79a43bd 100644 --- a/src/install/Cargo.toml +++ b/src/install/Cargo.toml @@ -2,6 +2,7 @@ name = "install" version = "0.0.1" authors = ["Ben Eills "] +build = "../../mkmain.rs" [lib] name = "uu_install" @@ -17,4 +18,4 @@ time = "0.1.38" [[bin]] name = "install" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/install/main.rs b/src/install/main.rs deleted file mode 100644 index fa1e578d8..000000000 --- a/src/install/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_install; - -fn main() { - std::process::exit(uu_install::uumain(std::env::args().collect())); -} diff --git a/src/kill/Cargo.toml b/src/kill/Cargo.toml index b42f671fd..41d91294f 100644 --- a/src/kill/Cargo.toml +++ b/src/kill/Cargo.toml @@ -2,6 +2,7 @@ name = "kill" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_kill" @@ -13,4 +14,4 @@ uucore = { path="../uucore" } [[bin]] name = "kill" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/kill/main.rs b/src/kill/main.rs deleted file mode 100644 index 201a81128..000000000 --- a/src/kill/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_kill; - -fn main() { - std::process::exit(uu_kill::uumain(std::env::args().collect())); -} diff --git a/src/link/Cargo.toml b/src/link/Cargo.toml index d1128a892..fdb130a54 100644 --- a/src/link/Cargo.toml +++ b/src/link/Cargo.toml @@ -2,6 +2,7 @@ name = "link" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_link" @@ -13,4 +14,4 @@ uucore = { path="../uucore" } [[bin]] name = "link" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/link/main.rs b/src/link/main.rs deleted file mode 100644 index 06d2c463e..000000000 --- a/src/link/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_link; - -fn main() { - std::process::exit(uu_link::uumain(std::env::args().collect())); -} diff --git a/src/ln/Cargo.toml b/src/ln/Cargo.toml index 1fabd8f76..c68723e59 100644 --- a/src/ln/Cargo.toml +++ b/src/ln/Cargo.toml @@ -2,6 +2,7 @@ name = "ln" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_ln" @@ -13,4 +14,4 @@ uucore = { path="../uucore" } [[bin]] name = "ln" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/ln/main.rs b/src/ln/main.rs deleted file mode 100644 index d797a7f52..000000000 --- a/src/ln/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_ln; - -fn main() { - std::process::exit(uu_ln::uumain(std::env::args().collect())); -} diff --git a/src/logname/Cargo.toml b/src/logname/Cargo.toml index 4865fc3fa..96f9bd33d 100644 --- a/src/logname/Cargo.toml +++ b/src/logname/Cargo.toml @@ -2,6 +2,7 @@ name = "logname" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_logname" @@ -13,4 +14,4 @@ uucore = { path="../uucore" } [[bin]] name = "logname" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/logname/main.rs b/src/logname/main.rs deleted file mode 100644 index 171ca5396..000000000 --- a/src/logname/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_logname; - -fn main() { - std::process::exit(uu_logname::uumain(std::env::args().collect())); -} diff --git a/src/ls/Cargo.toml b/src/ls/Cargo.toml index 6582fec19..fa6ecec1d 100644 --- a/src/ls/Cargo.toml +++ b/src/ls/Cargo.toml @@ -2,6 +2,7 @@ name = "ls" version = "0.0.1" authors = ["Jeremiah Peschka "] +build = "../../mkmain.rs" [lib] name = "uu_ls" @@ -23,4 +24,4 @@ features = ["entries"] [[bin]] name = "ls" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/ls/main.rs b/src/ls/main.rs deleted file mode 100644 index de1b75e8f..000000000 --- a/src/ls/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_ls; - -fn main() { - std::process::exit(uu_ls::uumain(std::env::args().collect())); -} diff --git a/src/mkdir/Cargo.toml b/src/mkdir/Cargo.toml index ebaf31029..f4787db4b 100644 --- a/src/mkdir/Cargo.toml +++ b/src/mkdir/Cargo.toml @@ -2,6 +2,7 @@ name = "mkdir" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_mkdir" @@ -14,4 +15,4 @@ uucore = { path="../uucore" } [[bin]] name = "mkdir" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/mkdir/main.rs b/src/mkdir/main.rs deleted file mode 100644 index 670750817..000000000 --- a/src/mkdir/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_mkdir; - -fn main() { - std::process::exit(uu_mkdir::uumain(std::env::args().collect())); -} diff --git a/src/mkfifo/Cargo.toml b/src/mkfifo/Cargo.toml index 08f6cc85d..d676d56be 100644 --- a/src/mkfifo/Cargo.toml +++ b/src/mkfifo/Cargo.toml @@ -2,6 +2,7 @@ name = "mkfifo" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_mkfifo" @@ -14,4 +15,4 @@ uucore = { path="../uucore" } [[bin]] name = "mkfifo" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/mkfifo/main.rs b/src/mkfifo/main.rs deleted file mode 100644 index 7cd6052fd..000000000 --- a/src/mkfifo/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_mkfifo; - -fn main() { - std::process::exit(uu_mkfifo::uumain(std::env::args().collect())); -} diff --git a/src/mknod/Cargo.toml b/src/mknod/Cargo.toml index de407e5b3..57694b146 100644 --- a/src/mknod/Cargo.toml +++ b/src/mknod/Cargo.toml @@ -2,6 +2,7 @@ name = "mknod" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_mknod" @@ -14,4 +15,4 @@ uucore = { path="../uucore" } [[bin]] name = "mknod" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/mknod/main.rs b/src/mknod/main.rs deleted file mode 100644 index 41cf1306d..000000000 --- a/src/mknod/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_mknod; - -fn main() { - std::process::exit(uu_mknod::uumain(std::env::args().collect())); -} diff --git a/src/mktemp/Cargo.toml b/src/mktemp/Cargo.toml index 3802f1b06..f72f5615e 100644 --- a/src/mktemp/Cargo.toml +++ b/src/mktemp/Cargo.toml @@ -2,6 +2,7 @@ name = "mktemp" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_mktemp" @@ -15,4 +16,4 @@ tempfile = "2.1.5" [[bin]] name = "mktemp" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/mktemp/main.rs b/src/mktemp/main.rs deleted file mode 100644 index c736c6feb..000000000 --- a/src/mktemp/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_mktemp; - -fn main() { - std::process::exit(uu_mktemp::uumain(std::env::args().collect())); -} diff --git a/src/more/Cargo.toml b/src/more/Cargo.toml index fe82c5059..85d5e7943 100644 --- a/src/more/Cargo.toml +++ b/src/more/Cargo.toml @@ -2,6 +2,7 @@ name = "more" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_more" @@ -16,4 +17,4 @@ nix = "0.8.1" [[bin]] name = "more" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/more/main.rs b/src/more/main.rs deleted file mode 100644 index b67081dd0..000000000 --- a/src/more/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_more; - -fn main() { - std::process::exit(uu_more::uumain(std::env::args().collect())); -} diff --git a/src/mv/Cargo.toml b/src/mv/Cargo.toml index 92418c219..22f227fc3 100644 --- a/src/mv/Cargo.toml +++ b/src/mv/Cargo.toml @@ -2,6 +2,7 @@ name = "mv" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_mv" @@ -13,4 +14,4 @@ uucore = { path="../uucore" } [[bin]] name = "mv" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/mv/main.rs b/src/mv/main.rs deleted file mode 100644 index bb0448229..000000000 --- a/src/mv/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_mv; - -fn main() { - std::process::exit(uu_mv::uumain(std::env::args().collect())); -} diff --git a/src/nice/Cargo.toml b/src/nice/Cargo.toml index f5f4a8500..07388949c 100644 --- a/src/nice/Cargo.toml +++ b/src/nice/Cargo.toml @@ -2,6 +2,7 @@ name = "nice" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_nice" @@ -14,4 +15,4 @@ uucore = { path="../uucore" } [[bin]] name = "nice" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/nice/main.rs b/src/nice/main.rs deleted file mode 100644 index cebe298a2..000000000 --- a/src/nice/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_nice; - -fn main() { - std::process::exit(uu_nice::uumain(std::env::args().collect())); -} diff --git a/src/nl/Cargo.toml b/src/nl/Cargo.toml index ca04dffb1..d67da0d42 100644 --- a/src/nl/Cargo.toml +++ b/src/nl/Cargo.toml @@ -2,6 +2,7 @@ name = "nl" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_nl" @@ -18,4 +19,4 @@ uucore = { path="../uucore" } [[bin]] name = "nl" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/nl/main.rs b/src/nl/main.rs deleted file mode 100644 index 70c017e78..000000000 --- a/src/nl/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_nl; - -fn main() { - std::process::exit(uu_nl::uumain(std::env::args().collect())); -} diff --git a/src/nohup/Cargo.toml b/src/nohup/Cargo.toml index 00b1614b8..6be2c707c 100644 --- a/src/nohup/Cargo.toml +++ b/src/nohup/Cargo.toml @@ -2,6 +2,7 @@ name = "nohup" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_nohup" @@ -14,4 +15,4 @@ uucore = { path="../uucore" } [[bin]] name = "nohup" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/nohup/main.rs b/src/nohup/main.rs deleted file mode 100644 index 52935b16f..000000000 --- a/src/nohup/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_nohup; - -fn main() { - std::process::exit(uu_nohup::uumain(std::env::args().collect())); -} diff --git a/src/nproc/Cargo.toml b/src/nproc/Cargo.toml index 12bc1ea79..7783b4555 100644 --- a/src/nproc/Cargo.toml +++ b/src/nproc/Cargo.toml @@ -2,6 +2,7 @@ name = "nproc" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_nproc" @@ -15,4 +16,4 @@ uucore = { path="../uucore" } [[bin]] name = "nproc" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/nproc/main.rs b/src/nproc/main.rs deleted file mode 100644 index 26a8ebbe4..000000000 --- a/src/nproc/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_nproc; - -fn main() { - std::process::exit(uu_nproc::uumain(std::env::args().collect())); -} diff --git a/src/numfmt/Cargo.toml b/src/numfmt/Cargo.toml index 04482581b..54e38f1ac 100644 --- a/src/numfmt/Cargo.toml +++ b/src/numfmt/Cargo.toml @@ -2,6 +2,7 @@ name = "numfmt" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_numfmt" @@ -13,4 +14,4 @@ uucore = { path="../uucore" } [[bin]] name = "numfmt" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/numfmt/main.rs b/src/numfmt/main.rs deleted file mode 100644 index ce5428394..000000000 --- a/src/numfmt/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_numfmt; - -fn main() { - std::process::exit(uu_numfmt::uumain(std::env::args().collect())); -} diff --git a/src/od/Cargo.toml b/src/od/Cargo.toml index 88286685b..cfbc98161 100644 --- a/src/od/Cargo.toml +++ b/src/od/Cargo.toml @@ -2,6 +2,7 @@ name = "od" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_od" @@ -16,4 +17,4 @@ uucore = { path="../uucore" } [[bin]] name = "od" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/od/main.rs b/src/od/main.rs deleted file mode 100644 index 6e3065cf5..000000000 --- a/src/od/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_od; - -fn main() { - std::process::exit(uu_od::uumain(std::env::args().collect())); -} diff --git a/src/paste/Cargo.toml b/src/paste/Cargo.toml index e4341390a..11b640016 100644 --- a/src/paste/Cargo.toml +++ b/src/paste/Cargo.toml @@ -2,6 +2,7 @@ name = "paste" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_paste" @@ -13,4 +14,4 @@ uucore = { path="../uucore" } [[bin]] name = "paste" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/paste/main.rs b/src/paste/main.rs deleted file mode 100644 index ef80ff695..000000000 --- a/src/paste/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_paste; - -fn main() { - std::process::exit(uu_paste::uumain(std::env::args().collect())); -} diff --git a/src/pathchk/Cargo.toml b/src/pathchk/Cargo.toml index e07ba3285..2edb8c27e 100644 --- a/src/pathchk/Cargo.toml +++ b/src/pathchk/Cargo.toml @@ -2,6 +2,7 @@ name = "pathchk" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_pathchk" @@ -14,4 +15,4 @@ uucore = { path="../uucore" } [[bin]] name = "pathchk" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/pathchk/main.rs b/src/pathchk/main.rs deleted file mode 100644 index 71e51454c..000000000 --- a/src/pathchk/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_pathchk; - -fn main() { - std::process::exit(uu_pathchk::uumain(std::env::args().collect())); -} diff --git a/src/pinky/Cargo.toml b/src/pinky/Cargo.toml index 28e1373e4..7bd38dc77 100644 --- a/src/pinky/Cargo.toml +++ b/src/pinky/Cargo.toml @@ -2,6 +2,7 @@ name = "pinky" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_pinky" @@ -14,4 +15,4 @@ features = ["utmpx", "entries"] [[bin]] name = "pinky" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/pinky/main.rs b/src/pinky/main.rs deleted file mode 100644 index 57068d670..000000000 --- a/src/pinky/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_pinky; - -fn main() { - std::process::exit(uu_pinky::uumain(std::env::args().collect())); -} diff --git a/src/printenv/Cargo.toml b/src/printenv/Cargo.toml index fc501aeed..aa52890ec 100644 --- a/src/printenv/Cargo.toml +++ b/src/printenv/Cargo.toml @@ -2,6 +2,7 @@ name = "printenv" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_printenv" @@ -13,4 +14,4 @@ uucore = { path="../uucore" } [[bin]] name = "printenv" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/printenv/main.rs b/src/printenv/main.rs deleted file mode 100644 index 03f34f399..000000000 --- a/src/printenv/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_printenv; - -fn main() { - std::process::exit(uu_printenv::uumain(std::env::args().collect())); -} diff --git a/src/printf/Cargo.toml b/src/printf/Cargo.toml index b2bac7d64..7b2a720ff 100644 --- a/src/printf/Cargo.toml +++ b/src/printf/Cargo.toml @@ -2,15 +2,16 @@ name = "printf" version = "0.0.1" authors = ["Nathan Ross"] +build = "../../mkmain.rs" [lib] name = "uu_printf" path = "printf.rs" [dependencies] -"itertools" = "0.6.0" +itertools = "0.6.0" uucore = { path="../uucore" } [[bin]] name = "printf" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/printf/main.rs b/src/printf/main.rs deleted file mode 100644 index 073aa250d..000000000 --- a/src/printf/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_printf; - -fn main() { - std::process::exit(uu_printf::uumain(std::env::args().collect())); -} diff --git a/src/ptx/Cargo.toml b/src/ptx/Cargo.toml index 29f7c32a4..1b12de7e6 100644 --- a/src/ptx/Cargo.toml +++ b/src/ptx/Cargo.toml @@ -2,6 +2,7 @@ name = "ptx" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_ptx" @@ -18,4 +19,4 @@ uucore = { path="../uucore" } [[bin]] name = "ptx" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/ptx/main.rs b/src/ptx/main.rs deleted file mode 100644 index af9ce7eed..000000000 --- a/src/ptx/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_ptx; - -fn main() { - std::process::exit(uu_ptx::uumain(std::env::args().collect())); -} diff --git a/src/pwd/Cargo.toml b/src/pwd/Cargo.toml index 02c1e6a5e..55115b12c 100644 --- a/src/pwd/Cargo.toml +++ b/src/pwd/Cargo.toml @@ -2,6 +2,7 @@ name = "pwd" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_pwd" @@ -13,4 +14,4 @@ uucore = { path="../uucore" } [[bin]] name = "pwd" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/pwd/main.rs b/src/pwd/main.rs deleted file mode 100644 index 60786163d..000000000 --- a/src/pwd/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_pwd; - -fn main() { - std::process::exit(uu_pwd::uumain(std::env::args().collect())); -} diff --git a/src/readlink/Cargo.toml b/src/readlink/Cargo.toml index d1bfb4764..42649257f 100644 --- a/src/readlink/Cargo.toml +++ b/src/readlink/Cargo.toml @@ -2,6 +2,7 @@ name = "readlink" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_readlink" @@ -14,4 +15,4 @@ uucore = { path="../uucore" } [[bin]] name = "readlink" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/readlink/main.rs b/src/readlink/main.rs deleted file mode 100644 index 367df8bb4..000000000 --- a/src/readlink/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_readlink; - -fn main() { - std::process::exit(uu_readlink::uumain(std::env::args().collect())); -} diff --git a/src/realpath/Cargo.toml b/src/realpath/Cargo.toml index 1dacda910..affac2f83 100644 --- a/src/realpath/Cargo.toml +++ b/src/realpath/Cargo.toml @@ -2,6 +2,7 @@ name = "realpath" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_realpath" @@ -13,4 +14,4 @@ uucore = { path="../uucore" } [[bin]] name = "realpath" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/realpath/main.rs b/src/realpath/main.rs deleted file mode 100644 index 8a695b809..000000000 --- a/src/realpath/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_realpath; - -fn main() { - std::process::exit(uu_realpath::uumain(std::env::args().collect())); -} diff --git a/src/relpath/Cargo.toml b/src/relpath/Cargo.toml index faa7e263d..402ac5888 100644 --- a/src/relpath/Cargo.toml +++ b/src/relpath/Cargo.toml @@ -2,6 +2,7 @@ name = "relpath" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_relpath" @@ -13,4 +14,4 @@ uucore = { path="../uucore" } [[bin]] name = "relpath" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/relpath/main.rs b/src/relpath/main.rs deleted file mode 100644 index 78b52a01f..000000000 --- a/src/relpath/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_relpath; - -fn main() { - std::process::exit(uu_relpath::uumain(std::env::args().collect())); -} diff --git a/src/rm/Cargo.toml b/src/rm/Cargo.toml index 51b305d16..8707f98dd 100644 --- a/src/rm/Cargo.toml +++ b/src/rm/Cargo.toml @@ -2,6 +2,7 @@ name = "rm" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_rm" @@ -15,4 +16,4 @@ uucore = { path="../uucore" } [[bin]] name = "rm" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/rm/main.rs b/src/rm/main.rs deleted file mode 100644 index b89ea4969..000000000 --- a/src/rm/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_rm; - -fn main() { - std::process::exit(uu_rm::uumain(std::env::args().collect())); -} diff --git a/src/rmdir/Cargo.toml b/src/rmdir/Cargo.toml index 6a2ac3220..783c70376 100644 --- a/src/rmdir/Cargo.toml +++ b/src/rmdir/Cargo.toml @@ -2,6 +2,7 @@ name = "rmdir" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_rmdir" @@ -13,4 +14,4 @@ uucore = { path="../uucore" } [[bin]] name = "rmdir" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/rmdir/main.rs b/src/rmdir/main.rs deleted file mode 100644 index dfd6172ed..000000000 --- a/src/rmdir/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_rmdir; - -fn main() { - std::process::exit(uu_rmdir::uumain(std::env::args().collect())); -} diff --git a/src/seq/Cargo.toml b/src/seq/Cargo.toml index cebc0080b..436a543d9 100644 --- a/src/seq/Cargo.toml +++ b/src/seq/Cargo.toml @@ -2,6 +2,7 @@ name = "seq" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_seq" @@ -13,4 +14,4 @@ uucore = { path="../uucore" } [[bin]] name = "seq" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/seq/main.rs b/src/seq/main.rs deleted file mode 100644 index 5a7d48048..000000000 --- a/src/seq/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_seq; - -fn main() { - std::process::exit(uu_seq::uumain(std::env::args().collect())); -} diff --git a/src/shred/Cargo.toml b/src/shred/Cargo.toml index cad2ce136..f2197542f 100644 --- a/src/shred/Cargo.toml +++ b/src/shred/Cargo.toml @@ -2,6 +2,7 @@ name = "shred" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_shred" @@ -17,4 +18,4 @@ uucore = { path="../uucore" } [[bin]] name = "shred" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/shred/main.rs b/src/shred/main.rs deleted file mode 100644 index 8c0e18274..000000000 --- a/src/shred/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_shred; - -fn main() { - std::process::exit(uu_shred::uumain(std::env::args().collect())); -} diff --git a/src/shuf/Cargo.toml b/src/shuf/Cargo.toml index fe1cff7d1..ed218d93c 100644 --- a/src/shuf/Cargo.toml +++ b/src/shuf/Cargo.toml @@ -2,6 +2,7 @@ name = "shuf" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_shuf" @@ -14,4 +15,4 @@ uucore = { path="../uucore" } [[bin]] name = "shuf" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/shuf/main.rs b/src/shuf/main.rs deleted file mode 100644 index 5c903d5af..000000000 --- a/src/shuf/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_shuf; - -fn main() { - std::process::exit(uu_shuf::uumain(std::env::args().collect())); -} diff --git a/src/sleep/Cargo.toml b/src/sleep/Cargo.toml index caa9f54e4..ad196cf7c 100644 --- a/src/sleep/Cargo.toml +++ b/src/sleep/Cargo.toml @@ -2,6 +2,7 @@ name = "sleep" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_sleep" @@ -13,4 +14,4 @@ uucore = { path="../uucore" } [[bin]] name = "sleep" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/sleep/main.rs b/src/sleep/main.rs deleted file mode 100644 index e52eb32ef..000000000 --- a/src/sleep/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_sleep; - -fn main() { - std::process::exit(uu_sleep::uumain(std::env::args().collect())); -} diff --git a/src/sort/Cargo.toml b/src/sort/Cargo.toml index 52387d014..cb5985b76 100644 --- a/src/sort/Cargo.toml +++ b/src/sort/Cargo.toml @@ -2,6 +2,7 @@ name = "sort" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_sort" @@ -15,4 +16,4 @@ uucore = { path="../uucore" } [[bin]] name = "sort" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/sort/main.rs b/src/sort/main.rs deleted file mode 100644 index 0b7b904b1..000000000 --- a/src/sort/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_sort; - -fn main() { - std::process::exit(uu_sort::uumain(std::env::args().collect())); -} diff --git a/src/split/Cargo.toml b/src/split/Cargo.toml index da08ecef8..6d4bcee25 100644 --- a/src/split/Cargo.toml +++ b/src/split/Cargo.toml @@ -2,6 +2,7 @@ name = "split" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_split" @@ -13,4 +14,4 @@ uucore = { path="../uucore" } [[bin]] name = "split" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/split/main.rs b/src/split/main.rs deleted file mode 100644 index 74705c681..000000000 --- a/src/split/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_split; - -fn main() { - std::process::exit(uu_split::uumain(std::env::args().collect())); -} diff --git a/src/stat/Cargo.toml b/src/stat/Cargo.toml index a25b67293..49c0cb641 100644 --- a/src/stat/Cargo.toml +++ b/src/stat/Cargo.toml @@ -2,6 +2,7 @@ name = "stat" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_stat" @@ -18,4 +19,4 @@ features = ["entries"] [[bin]] name = "stat" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/stat/main.rs b/src/stat/main.rs deleted file mode 100644 index 7a290254b..000000000 --- a/src/stat/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_stat; - -fn main() { - std::process::exit(uu_stat::uumain(std::env::args().collect())); -} diff --git a/src/stdbuf/Cargo.toml b/src/stdbuf/Cargo.toml index 9adc3667a..c4aebd1c1 100644 --- a/src/stdbuf/Cargo.toml +++ b/src/stdbuf/Cargo.toml @@ -18,4 +18,4 @@ cc = "1.0" [[bin]] name = "stdbuf" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/stdbuf/build.rs b/src/stdbuf/build.rs index 03cbf53de..c53bd59c0 100644 --- a/src/stdbuf/build.rs +++ b/src/stdbuf/build.rs @@ -1,5 +1,10 @@ use std::process::Command; +#[path = "../../mkmain.rs"] +mod mkmain; + fn main() { + mkmain::main(); + Command::new("make").output().expect("failed to execute make"); } diff --git a/src/stdbuf/main.rs b/src/stdbuf/main.rs deleted file mode 100644 index 4994146c2..000000000 --- a/src/stdbuf/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_stdbuf; - -fn main() { - std::process::exit(uu_stdbuf::uumain(std::env::args().collect())); -} diff --git a/src/sum/Cargo.toml b/src/sum/Cargo.toml index 13e9c1f8e..332f8607a 100644 --- a/src/sum/Cargo.toml +++ b/src/sum/Cargo.toml @@ -2,6 +2,7 @@ name = "sum" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_sum" @@ -13,4 +14,4 @@ uucore = { path="../uucore" } [[bin]] name = "sum" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/sum/main.rs b/src/sum/main.rs deleted file mode 100644 index 2c624161a..000000000 --- a/src/sum/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_sum; - -fn main() { - std::process::exit(uu_sum::uumain(std::env::args().collect())); -} diff --git a/src/sync/Cargo.toml b/src/sync/Cargo.toml index 15a111bb6..33ba4dfe9 100644 --- a/src/sync/Cargo.toml +++ b/src/sync/Cargo.toml @@ -2,6 +2,7 @@ name = "sync" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_sync" @@ -16,4 +17,4 @@ uucore = { path="../uucore" } [[bin]] name = "sync" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/sync/main.rs b/src/sync/main.rs deleted file mode 100644 index 254d1af24..000000000 --- a/src/sync/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_sync; - -fn main() { - std::process::exit(uu_sync::uumain(std::env::args().collect())); -} diff --git a/src/tac/Cargo.toml b/src/tac/Cargo.toml index a3558e9df..8201d8d54 100644 --- a/src/tac/Cargo.toml +++ b/src/tac/Cargo.toml @@ -2,6 +2,7 @@ name = "tac" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_tac" @@ -13,4 +14,4 @@ uucore = { path="../uucore" } [[bin]] name = "tac" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/tac/main.rs b/src/tac/main.rs deleted file mode 100644 index a12abd5af..000000000 --- a/src/tac/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_tac; - -fn main() { - std::process::exit(uu_tac::uumain(std::env::args().collect())); -} diff --git a/src/tail/Cargo.toml b/src/tail/Cargo.toml index b4ff5bb70..0f5f88cc2 100644 --- a/src/tail/Cargo.toml +++ b/src/tail/Cargo.toml @@ -2,6 +2,7 @@ name = "tail" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_tail" @@ -16,4 +17,4 @@ uucore = { path="../uucore" } [[bin]] name = "tail" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/tail/main.rs b/src/tail/main.rs deleted file mode 100644 index e547fc23f..000000000 --- a/src/tail/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_tail; - -fn main() { - std::process::exit(uu_tail::uumain(std::env::args().collect())); -} diff --git a/src/tee/Cargo.toml b/src/tee/Cargo.toml index 502f5f6de..06b765a8a 100644 --- a/src/tee/Cargo.toml +++ b/src/tee/Cargo.toml @@ -2,6 +2,7 @@ name = "tee" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_tee" @@ -14,4 +15,4 @@ uucore = { path="../uucore" } [[bin]] name = "tee" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/tee/main.rs b/src/tee/main.rs deleted file mode 100644 index 587397ff9..000000000 --- a/src/tee/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_tee; - -fn main() { - std::process::exit(uu_tee::uumain(std::env::args().collect())); -} diff --git a/src/test/Cargo.toml b/src/test/Cargo.toml index 7141275b6..15abef26d 100644 --- a/src/test/Cargo.toml +++ b/src/test/Cargo.toml @@ -2,6 +2,7 @@ name = "test" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_test" @@ -13,4 +14,4 @@ uucore = { path="../uucore" } [[bin]] name = "test" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/test/main.rs b/src/test/main.rs deleted file mode 100644 index 183d88639..000000000 --- a/src/test/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_test; - -fn main() { - std::process::exit(uu_test::uumain(std::env::args().collect())); -} diff --git a/src/timeout/Cargo.toml b/src/timeout/Cargo.toml index 5e31f58ee..ae28ccc59 100644 --- a/src/timeout/Cargo.toml +++ b/src/timeout/Cargo.toml @@ -2,6 +2,7 @@ name = "timeout" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_timeout" @@ -15,4 +16,4 @@ uucore = { path="../uucore" } [[bin]] name = "timeout" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/timeout/main.rs b/src/timeout/main.rs deleted file mode 100644 index 0e7646f9b..000000000 --- a/src/timeout/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_timeout; - -fn main() { - std::process::exit(uu_timeout::uumain(std::env::args().collect())); -} diff --git a/src/touch/Cargo.toml b/src/touch/Cargo.toml index 86a82f335..c7b8e4a26 100644 --- a/src/touch/Cargo.toml +++ b/src/touch/Cargo.toml @@ -2,6 +2,7 @@ name = "touch" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_touch" @@ -19,4 +20,4 @@ features = ["libc"] [[bin]] name = "touch" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/touch/main.rs b/src/touch/main.rs deleted file mode 100644 index de31a0391..000000000 --- a/src/touch/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_touch; - -fn main() { - std::process::exit(uu_touch::uumain(std::env::args().collect())); -} diff --git a/src/tr/Cargo.toml b/src/tr/Cargo.toml index f1e38f0b6..054fece62 100644 --- a/src/tr/Cargo.toml +++ b/src/tr/Cargo.toml @@ -2,6 +2,7 @@ name = "tr" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_tr" @@ -18,4 +19,4 @@ default-features = false [[bin]] name = "tr" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/tr/main.rs b/src/tr/main.rs deleted file mode 100644 index 8bc7f54d4..000000000 --- a/src/tr/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_tr; - -fn main() { - std::process::exit(uu_tr::uumain(std::env::args().collect())); -} diff --git a/src/true/Cargo.toml b/src/true/Cargo.toml index 4d5be508f..85d2fc5df 100644 --- a/src/true/Cargo.toml +++ b/src/true/Cargo.toml @@ -2,11 +2,15 @@ name = "true" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_true" path = "true.rs" +[dependencies] +uucore = { path = "../uucore" } + [[bin]] name = "true" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/true/main.rs b/src/true/main.rs deleted file mode 100644 index 6c1874c75..000000000 --- a/src/true/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_true; - -fn main() { - std::process::exit(uu_true::uumain(std::env::args().collect())); -} diff --git a/src/truncate/Cargo.toml b/src/truncate/Cargo.toml index da394341b..2d28afd75 100644 --- a/src/truncate/Cargo.toml +++ b/src/truncate/Cargo.toml @@ -2,6 +2,7 @@ name = "truncate" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_truncate" @@ -13,4 +14,4 @@ uucore = { path="../uucore" } [[bin]] name = "truncate" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/truncate/main.rs b/src/truncate/main.rs deleted file mode 100644 index d13c55415..000000000 --- a/src/truncate/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_truncate; - -fn main() { - std::process::exit(uu_truncate::uumain(std::env::args().collect())); -} diff --git a/src/tsort/Cargo.toml b/src/tsort/Cargo.toml index f19fc15fb..a7caf63ce 100644 --- a/src/tsort/Cargo.toml +++ b/src/tsort/Cargo.toml @@ -2,6 +2,7 @@ name = "tsort" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_tsort" @@ -13,4 +14,4 @@ uucore = { path="../uucore" } [[bin]] name = "tsort" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/tsort/main.rs b/src/tsort/main.rs deleted file mode 100644 index 36bdd64b8..000000000 --- a/src/tsort/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_tsort; - -fn main() { - std::process::exit(uu_tsort::uumain(std::env::args().collect())); -} diff --git a/src/tty/Cargo.toml b/src/tty/Cargo.toml index cce2c9276..6fd2abd24 100644 --- a/src/tty/Cargo.toml +++ b/src/tty/Cargo.toml @@ -2,6 +2,7 @@ name = "tty" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_tty" @@ -14,4 +15,4 @@ uucore = { path="../uucore" } [[bin]] name = "tty" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/tty/main.rs b/src/tty/main.rs deleted file mode 100644 index a210eee8e..000000000 --- a/src/tty/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_tty; - -fn main() { - std::process::exit(uu_tty::uumain(std::env::args().collect())); -} diff --git a/src/uname/Cargo.toml b/src/uname/Cargo.toml index 498bf0762..3b2520d3e 100644 --- a/src/uname/Cargo.toml +++ b/src/uname/Cargo.toml @@ -2,6 +2,7 @@ name = "uname" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_uname" @@ -14,4 +15,4 @@ features = ["utsname"] [[bin]] name = "uname" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/uname/main.rs b/src/uname/main.rs deleted file mode 100644 index 8a16b41b5..000000000 --- a/src/uname/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_uname; - -fn main() { - std::process::exit(uu_uname::uumain(std::env::args().collect())); -} diff --git a/src/unexpand/Cargo.toml b/src/unexpand/Cargo.toml index f088504ad..49bca8ba3 100644 --- a/src/unexpand/Cargo.toml +++ b/src/unexpand/Cargo.toml @@ -2,6 +2,7 @@ name = "unexpand" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_unexpand" @@ -14,4 +15,4 @@ uucore = { path="../uucore" } [[bin]] name = "unexpand" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/unexpand/main.rs b/src/unexpand/main.rs deleted file mode 100644 index 7f763a901..000000000 --- a/src/unexpand/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_unexpand; - -fn main() { - std::process::exit(uu_unexpand::uumain(std::env::args().collect())); -} diff --git a/src/uniq/Cargo.toml b/src/uniq/Cargo.toml index 162a24070..0ef73fc66 100644 --- a/src/uniq/Cargo.toml +++ b/src/uniq/Cargo.toml @@ -2,6 +2,7 @@ name = "uniq" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_uniq" @@ -16,4 +17,4 @@ default-features = false [[bin]] name = "uniq" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/uniq/main.rs b/src/uniq/main.rs deleted file mode 100644 index 19d33042f..000000000 --- a/src/uniq/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_uniq; - -fn main() { - std::process::exit(uu_uniq::uumain(std::env::args().collect())); -} diff --git a/src/unlink/Cargo.toml b/src/unlink/Cargo.toml index 578218c0b..96d88acb4 100644 --- a/src/unlink/Cargo.toml +++ b/src/unlink/Cargo.toml @@ -2,6 +2,7 @@ name = "unlink" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_unlink" @@ -14,4 +15,4 @@ uucore = { path="../uucore" } [[bin]] name = "unlink" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/unlink/main.rs b/src/unlink/main.rs deleted file mode 100644 index 6842d98b3..000000000 --- a/src/unlink/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_unlink; - -fn main() { - std::process::exit(uu_unlink::uumain(std::env::args().collect())); -} diff --git a/src/uptime/Cargo.toml b/src/uptime/Cargo.toml index 552604e62..275050bbc 100644 --- a/src/uptime/Cargo.toml +++ b/src/uptime/Cargo.toml @@ -2,6 +2,7 @@ name = "uptime" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_uptime" @@ -17,4 +18,4 @@ features = ["utmpx"] [[bin]] name = "uptime" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/uptime/main.rs b/src/uptime/main.rs deleted file mode 100644 index 324e3bf4a..000000000 --- a/src/uptime/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_uptime; - -fn main() { - std::process::exit(uu_uptime::uumain(std::env::args().collect())); -} diff --git a/src/users/Cargo.toml b/src/users/Cargo.toml index 16cbf36db..007d23973 100644 --- a/src/users/Cargo.toml +++ b/src/users/Cargo.toml @@ -2,6 +2,7 @@ name = "users" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_users" @@ -17,4 +18,4 @@ path = "../uucore" [[bin]] name = "users" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/users/main.rs b/src/users/main.rs deleted file mode 100644 index 596760442..000000000 --- a/src/users/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_users; - -fn main() { - std::process::exit(uu_users::uumain(std::env::args().collect())); -} diff --git a/src/uucore/lib.rs b/src/uucore/lib.rs index 9b1a5e763..3c6314d8a 100644 --- a/src/uucore/lib.rs +++ b/src/uucore/lib.rs @@ -7,6 +7,8 @@ mod macros; #[macro_use] pub mod coreopts; +pub mod panic; + #[cfg(feature = "fs")] pub mod fs; #[cfg(feature = "utf8")] diff --git a/src/uucore/panic.rs b/src/uucore/panic.rs new file mode 100644 index 000000000..765e035ab --- /dev/null +++ b/src/uucore/panic.rs @@ -0,0 +1,13 @@ +use std::panic; + +pub fn install_sigpipe_hook() { + let hook = panic::take_hook(); + panic::set_hook(Box::new(move |info| { + if let Some(res) = info.payload().downcast_ref::() { + if res.contains("Broken pipe") { + return; + } + } + hook(info) + })); +} diff --git a/src/uutils/uutils.rs b/src/uutils/uutils.rs index c7da94f13..ae7803532 100644 --- a/src/uutils/uutils.rs +++ b/src/uutils/uutils.rs @@ -14,6 +14,9 @@ include!(concat!(env!("OUT_DIR"), "/uutils_crates.rs")); use std::collections::hash_map::HashMap; use std::path::Path; use std::env; +use std::io::Write; + +extern crate uucore; static NAME: &'static str = "uutils"; static VERSION: &'static str = env!("CARGO_PKG_VERSION"); @@ -34,6 +37,8 @@ fn usage(cmap: &UtilityMap) { } fn main() { + uucore::panic::install_sigpipe_hook(); + let umap = util_map(); let mut args : Vec = env::args().collect(); @@ -80,7 +85,9 @@ fn main() { let util = &args[1][..]; match umap.get(util) { Some(&uumain) => { - std::process::exit(uumain(vec![util.to_owned(), "--help".to_owned()])); + let code = uumain(vec![util.to_owned(), "--help".to_owned()]); + std::io::stdout().flush().expect("could not flush stdout"); + std::process::exit(code); } None => { println!("{}: applet not found", util); diff --git a/src/wc/Cargo.toml b/src/wc/Cargo.toml index d38d86ca2..3b9994085 100644 --- a/src/wc/Cargo.toml +++ b/src/wc/Cargo.toml @@ -2,6 +2,7 @@ name = "wc" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_wc" @@ -13,4 +14,4 @@ uucore = { path="../uucore" } [[bin]] name = "wc" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/wc/main.rs b/src/wc/main.rs deleted file mode 100644 index c09239aa1..000000000 --- a/src/wc/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_wc; - -fn main() { - std::process::exit(uu_wc::uumain(std::env::args().collect())); -} diff --git a/src/who/Cargo.toml b/src/who/Cargo.toml index 55bca68fa..2275d67e2 100644 --- a/src/who/Cargo.toml +++ b/src/who/Cargo.toml @@ -2,6 +2,7 @@ name = "who" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_who" @@ -18,4 +19,4 @@ optional = true [[bin]] name = "who" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/who/main.rs b/src/who/main.rs deleted file mode 100644 index 2c3de969a..000000000 --- a/src/who/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_who; - -fn main() { - std::process::exit(uu_who::uumain(std::env::args().collect())); -} diff --git a/src/whoami/Cargo.toml b/src/whoami/Cargo.toml index afb67bbba..0768c0ee8 100644 --- a/src/whoami/Cargo.toml +++ b/src/whoami/Cargo.toml @@ -2,6 +2,7 @@ name = "whoami" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_whoami" @@ -19,4 +20,4 @@ features = ["entries"] [[bin]] name = "whoami" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/whoami/main.rs b/src/whoami/main.rs deleted file mode 100644 index a9a0610b9..000000000 --- a/src/whoami/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_whoami; - -fn main() { - std::process::exit(uu_whoami::uumain(std::env::args().collect())); -} diff --git a/src/yes/Cargo.toml b/src/yes/Cargo.toml index e48223ebb..ae5bf20f6 100644 --- a/src/yes/Cargo.toml +++ b/src/yes/Cargo.toml @@ -2,6 +2,7 @@ name = "yes" version = "0.0.1" authors = [] +build = "../../mkmain.rs" [lib] name = "uu_yes" @@ -13,4 +14,4 @@ uucore = { path="../uucore" } [[bin]] name = "yes" -path = "main.rs" +path = "../../uumain.rs" diff --git a/src/yes/main.rs b/src/yes/main.rs deleted file mode 100644 index ffe9d2c9d..000000000 --- a/src/yes/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate uu_yes; - -fn main() { - std::process::exit(uu_yes::uumain(std::env::args().collect())); -} diff --git a/uumain.rs b/uumain.rs new file mode 100644 index 000000000..3fa1dd87a --- /dev/null +++ b/uumain.rs @@ -0,0 +1 @@ +include!(concat!(env!("OUT_DIR"), "/main.rs")); \ No newline at end of file