diff --git a/src/base64/base64.rs b/src/base64/base64.rs index 9196b0399..fff3f9a6b 100644 --- a/src/base64/base64.rs +++ b/src/base64/base64.rs @@ -32,7 +32,7 @@ enum Mode { } static NAME: &'static str = "base64"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub type FileOrStdReader = BufReader>; diff --git a/src/basename/basename.rs b/src/basename/basename.rs index 6ca4cf002..366299cbf 100644 --- a/src/basename/basename.rs +++ b/src/basename/basename.rs @@ -20,7 +20,7 @@ use std::io::Write; use std::path::{is_separator, PathBuf}; static NAME: &'static str = "basename"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub fn uumain(args: Vec) -> i32 { // diff --git a/src/cat/cat.rs b/src/cat/cat.rs index 829d46614..ad5a6d857 100644 --- a/src/cat/cat.rs +++ b/src/cat/cat.rs @@ -25,7 +25,7 @@ use std::intrinsics::{copy_nonoverlapping}; use std::io::{stdout, stdin, stderr, Write, Read, Result}; static NAME: &'static str = "cat"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub fn uumain(args: Vec) -> i32 { let mut opts = Options::new(); diff --git a/src/chmod/chmod.rs b/src/chmod/chmod.rs index 9271d1bbe..6371e9ff8 100644 --- a/src/chmod/chmod.rs +++ b/src/chmod/chmod.rs @@ -32,7 +32,7 @@ use uucore::fs::UUPathExt; use walker::Walker; const NAME: &'static str = "chmod"; -const VERSION: &'static str = "1.0.0"; +const VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub fn uumain(args: Vec) -> i32 { let mut opts = Options::new(); diff --git a/src/chroot/chroot.rs b/src/chroot/chroot.rs index a69147e80..3787ff1fa 100644 --- a/src/chroot/chroot.rs +++ b/src/chroot/chroot.rs @@ -40,7 +40,7 @@ extern { } static NAME: &'static str = "chroot"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub fn uumain(args: Vec) -> i32 { let mut opts = Options::new(); diff --git a/src/cksum/cksum.rs b/src/cksum/cksum.rs index 42548833e..4d5581a6c 100644 --- a/src/cksum/cksum.rs +++ b/src/cksum/cksum.rs @@ -25,7 +25,7 @@ use crc_table::CRC_TABLE; mod crc_table; static NAME: &'static str = "cksum"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); #[inline] fn crc_update(crc: u32, input: u8) -> u32 { diff --git a/src/comm/comm.rs b/src/comm/comm.rs index 5518f6461..ee37afd94 100644 --- a/src/comm/comm.rs +++ b/src/comm/comm.rs @@ -18,7 +18,7 @@ use std::io::{self, BufRead, BufReader, Read, stdin, Stdin}; use std::path::Path; static NAME: &'static str = "comm"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); fn mkdelim(col: usize, opts: &getopts::Matches) -> String { let mut s = String::new(); diff --git a/src/cp/cp.rs b/src/cp/cp.rs index 04d0c8ea1..08e1c9988 100644 --- a/src/cp/cp.rs +++ b/src/cp/cp.rs @@ -28,7 +28,7 @@ pub enum Mode { } static NAME: &'static str = "cp"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub fn uumain(args: Vec) -> i32 { let mut opts = Options::new(); diff --git a/src/cut/cut.rs b/src/cut/cut.rs index a05679f08..631f4c98f 100644 --- a/src/cut/cut.rs +++ b/src/cut/cut.rs @@ -28,7 +28,7 @@ mod ranges; mod searcher; static NAME: &'static str = "cut"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); struct Options { out_delim: Option, diff --git a/src/dirname/dirname.rs b/src/dirname/dirname.rs index c1a3ce60f..1002db892 100644 --- a/src/dirname/dirname.rs +++ b/src/dirname/dirname.rs @@ -14,7 +14,7 @@ extern crate getopts; use std::path::Path; static NAME: &'static str = "dirname"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub fn uumain(args: Vec) -> i32 { let mut opts = getopts::Options::new(); diff --git a/src/du/du.rs b/src/du/du.rs index cb60dcb0f..83e9b91fb 100644 --- a/src/du/du.rs +++ b/src/du/du.rs @@ -28,7 +28,7 @@ use std::sync::mpsc::channel; use std::thread; static NAME: &'static str = "du"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); struct Options { all: bool, diff --git a/src/echo/echo.rs b/src/echo/echo.rs index 0e7508dfb..b55d4f930 100644 --- a/src/echo/echo.rs +++ b/src/echo/echo.rs @@ -20,7 +20,7 @@ use std::str::from_utf8; #[allow(dead_code)] static NAME: &'static str = "echo"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); #[derive(Clone)] struct EchoOptions { diff --git a/src/env/env.rs b/src/env/env.rs index eb5d8ebcb..fadd3aee1 100644 --- a/src/env/env.rs +++ b/src/env/env.rs @@ -21,7 +21,7 @@ use std::io::Write; use std::process::Command; static NAME: &'static str = "env"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); struct options { ignore_env: bool, diff --git a/src/expand/expand.rs b/src/expand/expand.rs index 5312e631d..56c9541d0 100644 --- a/src/expand/expand.rs +++ b/src/expand/expand.rs @@ -28,7 +28,7 @@ use rustc_unicode::str::utf8_char_width; use unicode_width::UnicodeWidthChar; static NAME: &'static str = "expand"; -static VERSION: &'static str = "0.0.1"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); static DEFAULT_TABSTOP: usize = 8; diff --git a/src/expr/expr.rs b/src/expr/expr.rs index 9ed14f160..712d8bc9c 100644 --- a/src/expr/expr.rs +++ b/src/expr/expr.rs @@ -21,7 +21,7 @@ mod syntax_tree; use std::io::{Write}; static NAME: &'static str = "expr"; -static VERSION: &'static str = "0.0.1"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub fn uumain(args: Vec) -> i32 { // For expr utility we do not want getopts. diff --git a/src/factor/factor.rs b/src/factor/factor.rs index 6399b4383..aa01a782e 100644 --- a/src/factor/factor.rs +++ b/src/factor/factor.rs @@ -33,7 +33,7 @@ mod numeric; mod prime_table; static NAME: &'static str = "factor"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); fn rho_pollard_pseudorandom_function(x: u64, a: u64, b: u64, num: u64) -> u64 { if num < 1 << 63 { diff --git a/src/fmt/fmt.rs b/src/fmt/fmt.rs index 06cb6205d..5dee29609 100644 --- a/src/fmt/fmt.rs +++ b/src/fmt/fmt.rs @@ -38,7 +38,7 @@ mod parasplit; // program's NAME and VERSION are used for -V and -h static NAME: &'static str = "fmt"; -static VERSION: &'static str = "0.0.3"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub type FileOrStdReader = BufReader>; pub struct FmtOptions { diff --git a/src/fold/fold.rs b/src/fold/fold.rs index d75a317e4..fcaf77ab3 100644 --- a/src/fold/fold.rs +++ b/src/fold/fold.rs @@ -20,7 +20,7 @@ use std::io::{BufRead, BufReader, Read, stdin, Write}; use std::path::Path; static NAME: &'static str = "fold"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub fn uumain(args: Vec) -> i32 { let (args, obs_width) = handle_obsolete(&args[..]); diff --git a/src/groups/groups.rs b/src/groups/groups.rs index 834922b84..1eac56dc8 100644 --- a/src/groups/groups.rs +++ b/src/groups/groups.rs @@ -19,7 +19,7 @@ use std::io::Write; use uucore::c_types::{get_pw_from_args, group}; static NAME: &'static str = "groups"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub fn uumain(args: Vec) -> i32 { let mut opts = getopts::Options::new(); diff --git a/src/hashsum/hashsum.rs b/src/hashsum/hashsum.rs index 5fedb7e9b..90fb79f14 100644 --- a/src/hashsum/hashsum.rs +++ b/src/hashsum/hashsum.rs @@ -30,7 +30,7 @@ use std::io::{self, BufRead, BufReader, Read, stdin, Write}; use std::path::Path; static NAME: &'static str = "hashsum"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); fn is_custom_binary(program: &str) -> bool { match program { diff --git a/src/head/head.rs b/src/head/head.rs index 9d539687e..1702172fa 100644 --- a/src/head/head.rs +++ b/src/head/head.rs @@ -22,7 +22,7 @@ use std::path::Path; use std::str::from_utf8; static NAME: &'static str = "head"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); enum FilterMode { Bytes(usize), diff --git a/src/hostid/hostid.rs b/src/hostid/hostid.rs index bab2c50a1..dd9a5305d 100644 --- a/src/hostid/hostid.rs +++ b/src/hostid/hostid.rs @@ -18,7 +18,7 @@ extern crate uucore; use libc::c_long; static NAME: &'static str = "hostid"; -static VERSION: &'static str = "0.0.1"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); static EXIT_ERR: i32 = 1; diff --git a/src/hostname/hostname.rs b/src/hostname/hostname.rs index 4e01de294..3dae3ff28 100644 --- a/src/hostname/hostname.rs +++ b/src/hostname/hostname.rs @@ -27,7 +27,7 @@ use std::io::Write; use std::net::ToSocketAddrs; static NAME: &'static str = "hostname"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); extern { fn gethostname(name: *mut libc::c_char, namelen: libc::size_t) -> libc::c_int; diff --git a/src/kill/kill.rs b/src/kill/kill.rs index 08626b850..0d0625cf2 100644 --- a/src/kill/kill.rs +++ b/src/kill/kill.rs @@ -20,7 +20,7 @@ use std::io::{Error, Write}; use uucore::signals::ALL_SIGNALS; static NAME: &'static str = "kill"; -static VERSION: &'static str = "0.0.1"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); static EXIT_OK: i32 = 0; static EXIT_ERR: i32 = 1; diff --git a/src/link/link.rs b/src/link/link.rs index 37fde7d4a..8b8c77c2a 100644 --- a/src/link/link.rs +++ b/src/link/link.rs @@ -19,7 +19,7 @@ use std::io::Write; use std::path::Path; static NAME: &'static str = "link"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub fn uumain(args: Vec) -> i32 { let mut opts = getopts::Options::new(); diff --git a/src/ln/ln.rs b/src/ln/ln.rs index 6e8e19518..104874008 100644 --- a/src/ln/ln.rs +++ b/src/ln/ln.rs @@ -22,7 +22,7 @@ use std::path::{Path, PathBuf}; use uucore::fs::UUPathExt; static NAME: &'static str = "ln"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub struct Settings { overwrite: OverwriteMode, diff --git a/src/logname/logname.rs b/src/logname/logname.rs index 6e5dd0465..b0c3ca455 100644 --- a/src/logname/logname.rs +++ b/src/logname/logname.rs @@ -37,7 +37,7 @@ fn get_userlogin() -> Option { } static NAME: &'static str = "logname"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub fn uumain(args: Vec) -> i32 { // diff --git a/src/mkdir/mkdir.rs b/src/mkdir/mkdir.rs index dffcbc78a..f1c4e97de 100644 --- a/src/mkdir/mkdir.rs +++ b/src/mkdir/mkdir.rs @@ -22,7 +22,7 @@ use std::path::{Path, PathBuf}; use uucore::fs::UUPathExt; static NAME: &'static str = "mkdir"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); /** * Handles option parsing diff --git a/src/mkfifo/mkfifo.rs b/src/mkfifo/mkfifo.rs index 795b689be..468cd83e2 100644 --- a/src/mkfifo/mkfifo.rs +++ b/src/mkfifo/mkfifo.rs @@ -20,7 +20,7 @@ use std::ffi::CString; use std::io::{Error, Write}; static NAME: &'static str = "mkfifo"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub fn uumain(args: Vec) -> i32 { let mut opts = getopts::Options::new(); diff --git a/src/mv/mv.rs b/src/mv/mv.rs index f84a0ae2b..a401b87bf 100644 --- a/src/mv/mv.rs +++ b/src/mv/mv.rs @@ -23,7 +23,7 @@ use std::path::{Path, PathBuf}; use uucore::fs::UUPathExt; static NAME: &'static str = "mv"; -static VERSION: &'static str = "0.0.1"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub struct Behaviour { overwrite: OverwriteMode, diff --git a/src/nice/nice.rs b/src/nice/nice.rs index 92d4d85f5..8259983d9 100644 --- a/src/nice/nice.rs +++ b/src/nice/nice.rs @@ -20,7 +20,7 @@ use std::ffi::CString; use std::io::{Error, Write}; const NAME: &'static str = "nice"; -const VERSION: &'static str = "1.0.0"; +const VERSION: &'static str = env!("CARGO_PKG_VERSION"); // XXX: PRIO_PROCESS is 0 on at least FreeBSD and Linux. Don't know about Mac OS X. const PRIO_PROCESS: c_int = 0; diff --git a/src/nl/nl.rs b/src/nl/nl.rs index 7b15bd3e6..fd77539cb 100644 --- a/src/nl/nl.rs +++ b/src/nl/nl.rs @@ -27,7 +27,7 @@ use std::path::Path; mod helper; static NAME: &'static str = "nl"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); static USAGE: &'static str = "nl [OPTION]... [FILE]..."; // A regular expression matching everything. diff --git a/src/nohup/nohup.rs b/src/nohup/nohup.rs index e0cdd4b98..4f47c123b 100644 --- a/src/nohup/nohup.rs +++ b/src/nohup/nohup.rs @@ -25,7 +25,7 @@ use std::path::{Path, PathBuf}; use std::env; static NAME: &'static str = "nohup"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); #[cfg(target_os = "macos")] extern { diff --git a/src/nproc/nproc.rs b/src/nproc/nproc.rs index f0b7c97fb..2cc143650 100644 --- a/src/nproc/nproc.rs +++ b/src/nproc/nproc.rs @@ -18,8 +18,8 @@ extern crate uucore; use std::io::Write; use std::env; -static NAME : &'static str = "nproc"; -static VERSION : &'static str = "0.0.0"; +static NAME: &'static str = "nproc"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub fn uumain(args: Vec) -> i32 { let mut opts = getopts::Options::new(); diff --git a/src/paste/paste.rs b/src/paste/paste.rs index f170452af..52a899b1e 100644 --- a/src/paste/paste.rs +++ b/src/paste/paste.rs @@ -21,7 +21,7 @@ use std::fs::File; use std::path::Path; static NAME: &'static str = "paste"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub fn uumain(args: Vec) -> i32 { let mut opts = getopts::Options::new(); diff --git a/src/printenv/printenv.rs b/src/printenv/printenv.rs index 025294cff..5025a3194 100644 --- a/src/printenv/printenv.rs +++ b/src/printenv/printenv.rs @@ -21,7 +21,7 @@ use std::io::Write; use std::env; static NAME: &'static str = "printenv"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub fn uumain(args: Vec) -> i32 { let mut opts = getopts::Options::new(); diff --git a/src/ptx/ptx.rs b/src/ptx/ptx.rs index 681ffa5ea..e39cf19a5 100644 --- a/src/ptx/ptx.rs +++ b/src/ptx/ptx.rs @@ -27,7 +27,7 @@ use std::fs::File; use std::io::{stdin, stdout, BufReader, BufWriter, BufRead, Read, Write}; static NAME: &'static str = "ptx"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); #[derive(Debug)] enum OutFormat { diff --git a/src/pwd/pwd.rs b/src/pwd/pwd.rs index 0f423ae2f..b144d7f52 100644 --- a/src/pwd/pwd.rs +++ b/src/pwd/pwd.rs @@ -19,7 +19,7 @@ use std::io::Write; use std::env; static NAME: &'static str = "pwd"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub fn uumain(args: Vec) -> i32 { let mut opts = getopts::Options::new(); diff --git a/src/readlink/readlink.rs b/src/readlink/readlink.rs index 9249bd5fd..d6a8ad4a4 100644 --- a/src/readlink/readlink.rs +++ b/src/readlink/readlink.rs @@ -20,7 +20,7 @@ use std::path::PathBuf; use uucore::fs::{canonicalize, CanonicalizeMode}; const NAME: &'static str = "readlink"; -const VERSION: &'static str = "0.0.1"; +const VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub fn uumain(args: Vec) -> i32 { let mut opts = getopts::Options::new(); diff --git a/src/realpath/realpath.rs b/src/realpath/realpath.rs index a0b6cda4f..bf4dd3dad 100644 --- a/src/realpath/realpath.rs +++ b/src/realpath/realpath.rs @@ -21,7 +21,7 @@ use std::path::{Path, PathBuf}; use uucore::fs::{canonicalize, CanonicalizeMode}; static NAME: &'static str = "realpath"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub fn uumain(args: Vec) -> i32 { let mut opts = getopts::Options::new(); diff --git a/src/relpath/relpath.rs b/src/relpath/relpath.rs index ab982c7f0..877792965 100644 --- a/src/relpath/relpath.rs +++ b/src/relpath/relpath.rs @@ -21,7 +21,7 @@ use std::path::{Path, PathBuf}; use uucore::fs::{canonicalize, CanonicalizeMode}; static NAME: &'static str = "relpath"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub fn uumain(args: Vec) -> i32 { let mut opts = getopts::Options::new(); diff --git a/src/rm/rm.rs b/src/rm/rm.rs index c9d859dc5..96b426aa8 100644 --- a/src/rm/rm.rs +++ b/src/rm/rm.rs @@ -30,7 +30,7 @@ enum InteractiveMode { } static NAME: &'static str = "rm"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub fn uumain(args: Vec) -> i32 { // TODO: make getopts support -R in addition to -r diff --git a/src/rmdir/rmdir.rs b/src/rmdir/rmdir.rs index dba5d0332..43c0c2d61 100644 --- a/src/rmdir/rmdir.rs +++ b/src/rmdir/rmdir.rs @@ -20,7 +20,7 @@ use std::io::Write; use std::path::Path; static NAME: &'static str = "rmdir"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub fn uumain(args: Vec) -> i32 { let mut opts = getopts::Options::new(); diff --git a/src/seq/seq.rs b/src/seq/seq.rs index 90de55d32..299f26804 100644 --- a/src/seq/seq.rs +++ b/src/seq/seq.rs @@ -13,7 +13,7 @@ use std::cmp; use std::io::Write; static NAME: &'static str = "seq"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); #[derive(Clone)] struct SeqOptions { diff --git a/src/shuf/shuf.rs b/src/shuf/shuf.rs index 87e5a8b0f..d76a3a5b6 100644 --- a/src/shuf/shuf.rs +++ b/src/shuf/shuf.rs @@ -29,7 +29,7 @@ enum Mode { } static NAME: &'static str = "shuf"; -static VERSION: &'static str = "0.0.1"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub fn uumain(args: Vec) -> i32 { let mut opts = getopts::Options::new(); diff --git a/src/sleep/sleep.rs b/src/sleep/sleep.rs index 5052988a7..0b6fc4312 100644 --- a/src/sleep/sleep.rs +++ b/src/sleep/sleep.rs @@ -21,7 +21,7 @@ use std::time::Duration; use std::u32::MAX as U32_MAX; static NAME: &'static str = "sleep"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub fn uumain(args: Vec) -> i32 { let mut opts = getopts::Options::new(); diff --git a/src/sort/sort.rs b/src/sort/sort.rs index 89710a571..f0d7ae6e5 100644 --- a/src/sort/sort.rs +++ b/src/sort/sort.rs @@ -25,7 +25,7 @@ use std::io::{BufRead, BufReader, Read, stdin, Write}; use std::path::Path; static NAME: &'static str = "sort"; -static VERSION: &'static str = "0.0.1"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); static DECIMAL_PT: char = '.'; static THOUSANDS_SEP: char = ','; diff --git a/src/split/split.rs b/src/split/split.rs index de9b27817..c601965dd 100644 --- a/src/split/split.rs +++ b/src/split/split.rs @@ -21,7 +21,7 @@ use std::io::{BufRead, BufReader, BufWriter, Read, stdin, stdout, Write}; use std::path::Path; static NAME: &'static str = "split"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub fn uumain(args: Vec) -> i32 { let mut opts = getopts::Options::new(); diff --git a/src/stdbuf/stdbuf.rs b/src/stdbuf/stdbuf.rs index ff24c23eb..008e8f503 100644 --- a/src/stdbuf/stdbuf.rs +++ b/src/stdbuf/stdbuf.rs @@ -23,7 +23,7 @@ use std::process::Command; use uucore::fs::{canonicalize, CanonicalizeMode, UUPathExt}; static NAME: &'static str = "stdbuf"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); static LIBSTDBUF: &'static str = "libstdbuf"; enum BufferType { diff --git a/src/sum/sum.rs b/src/sum/sum.rs index 49b131e2c..bc59c63c9 100644 --- a/src/sum/sum.rs +++ b/src/sum/sum.rs @@ -20,7 +20,7 @@ use std::io::{Read, Result, stdin, Write}; use std::path::Path; static NAME: &'static str = "sum"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); fn bsd_sum(mut reader: Box) -> (usize, u16) { let mut buf = [0; 1024]; diff --git a/src/sync/sync.rs b/src/sync/sync.rs index a23e0c123..bbca4e3fe 100644 --- a/src/sync/sync.rs +++ b/src/sync/sync.rs @@ -18,7 +18,7 @@ extern crate libc; extern crate uucore; static NAME: &'static str = "sync"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); #[cfg(unix)] mod platform { diff --git a/src/tac/tac.rs b/src/tac/tac.rs index 3620d948b..953ca53ce 100644 --- a/src/tac/tac.rs +++ b/src/tac/tac.rs @@ -19,7 +19,7 @@ use std::fs::File; use std::io::{BufReader, Read, stdin, stdout, Stdout, Write}; static NAME: &'static str = "tac"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub fn uumain(args: Vec) -> i32 { let mut opts = getopts::Options::new(); diff --git a/src/tail/tail.rs b/src/tail/tail.rs index 790a162ac..0aec74d20 100644 --- a/src/tail/tail.rs +++ b/src/tail/tail.rs @@ -24,7 +24,7 @@ use std::thread::sleep; use std::time::Duration; static NAME: &'static str = "tail"; -static VERSION: &'static str = "0.0.1"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub fn uumain(args: Vec) -> i32 { let mut beginning = false; diff --git a/src/tee/tee.rs b/src/tee/tee.rs index fd3cafa61..c22f1e136 100644 --- a/src/tee/tee.rs +++ b/src/tee/tee.rs @@ -19,7 +19,7 @@ use std::io::{copy, Error, ErrorKind, Read, Result, sink, stdin, stdout, Write}; use std::path::{Path, PathBuf}; static NAME: &'static str = "tee"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub fn uumain(args: Vec) -> i32 { match options(&args).and_then(exec) { diff --git a/src/timeout/timeout.rs b/src/timeout/timeout.rs index 2572aa3b7..84d618b85 100644 --- a/src/timeout/timeout.rs +++ b/src/timeout/timeout.rs @@ -27,7 +27,7 @@ extern { } static NAME: &'static str = "timeout"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); static ERR_EXIT_STATUS: i32 = 125; diff --git a/src/touch/touch.rs b/src/touch/touch.rs index f4f8e3d16..975dad316 100644 --- a/src/touch/touch.rs +++ b/src/touch/touch.rs @@ -24,7 +24,7 @@ use std::path::Path; use uucore::fs::UUPathExt; static NAME: &'static str = "touch"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); // Since touch's date/timestamp parsing doesn't account for timezone, the // returned value from time::strptime() is UTC. We get system's timezone to diff --git a/src/tr/tr.rs b/src/tr/tr.rs index cdd30deef..1b06c9829 100644 --- a/src/tr/tr.rs +++ b/src/tr/tr.rs @@ -29,7 +29,7 @@ use expand::ExpandSet; mod expand; static NAME: &'static str = "tr"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); const BUFFER_LEN: usize = 1024; fn delete<'a>(set: ExpandSet<'a>, complement: bool) { diff --git a/src/truncate/truncate.rs b/src/truncate/truncate.rs index 361371f50..6b3583e4f 100644 --- a/src/truncate/truncate.rs +++ b/src/truncate/truncate.rs @@ -32,7 +32,7 @@ enum TruncateMode { } static NAME: &'static str = "truncate"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub fn uumain(args: Vec) -> i32 { let mut opts = getopts::Options::new(); diff --git a/src/tsort/tsort.rs b/src/tsort/tsort.rs index de2a6348d..568b1faae 100644 --- a/src/tsort/tsort.rs +++ b/src/tsort/tsort.rs @@ -22,7 +22,7 @@ use std::io::{BufRead, BufReader, Read, stdin, Write}; use std::path::Path; static NAME: &'static str = "tsort"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub fn uumain(args: Vec) -> i32 { let mut opts = getopts::Options::new(); diff --git a/src/tty/tty.rs b/src/tty/tty.rs index 039f28b3f..097a77423 100644 --- a/src/tty/tty.rs +++ b/src/tty/tty.rs @@ -26,7 +26,7 @@ extern { } static NAME: &'static str = "tty"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub fn uumain(args: Vec) -> i32 { let mut opts = getopts::Options::new(); diff --git a/src/uname/uname.rs b/src/uname/uname.rs index 75a14f8c8..6641f7a09 100644 --- a/src/uname/uname.rs +++ b/src/uname/uname.rs @@ -51,7 +51,7 @@ unsafe fn getuname() -> Uts { } static NAME: &'static str = "uname"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub fn uumain(args: Vec) -> i32 { let mut opts = getopts::Options::new(); diff --git a/src/unexpand/unexpand.rs b/src/unexpand/unexpand.rs index a8af2635d..d030f1b4b 100644 --- a/src/unexpand/unexpand.rs +++ b/src/unexpand/unexpand.rs @@ -27,7 +27,7 @@ use rustc_unicode::str::utf8_char_width; use unicode_width::UnicodeWidthChar; static NAME: &'static str = "unexpand"; -static VERSION: &'static str = "0.0.1"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); static DEFAULT_TABSTOP: usize = 8; diff --git a/src/uniq/uniq.rs b/src/uniq/uniq.rs index 273339ae3..1ad51c9b7 100644 --- a/src/uniq/uniq.rs +++ b/src/uniq/uniq.rs @@ -23,7 +23,7 @@ use std::path::Path; use std::str::FromStr; static NAME: &'static str = "uniq"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); struct Uniq { repeats_only: bool, diff --git a/src/unlink/unlink.rs b/src/unlink/unlink.rs index 186ef24cf..25f70e3dc 100644 --- a/src/unlink/unlink.rs +++ b/src/unlink/unlink.rs @@ -24,7 +24,7 @@ use std::io::{Error, ErrorKind, Write}; use std::mem::uninitialized; static NAME: &'static str = "unlink"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub fn uumain(args: Vec) -> i32 { let mut opts = Options::new(); diff --git a/src/uptime/uptime.rs b/src/uptime/uptime.rs index 24170fa1d..24c801f28 100644 --- a/src/uptime/uptime.rs +++ b/src/uptime/uptime.rs @@ -28,7 +28,7 @@ use std::ptr::null; use uucore::utmpx::*; static NAME: &'static str = "uptime"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); #[cfg(unix)] extern { diff --git a/src/users/users.rs b/src/users/users.rs index c33b503cb..c7a6dd030 100644 --- a/src/users/users.rs +++ b/src/users/users.rs @@ -46,7 +46,7 @@ unsafe extern fn utmpxname(_file: *const libc::c_char) -> libc::c_int { } static NAME: &'static str = "users"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub fn uumain(args: Vec) -> i32 { let mut opts = Options::new(); diff --git a/src/uutils/uutils.rs b/src/uutils/uutils.rs index 45a5353e7..b5b5f9c81 100644 --- a/src/uutils/uutils.rs +++ b/src/uutils/uutils.rs @@ -16,7 +16,7 @@ use std::path::Path; use std::env; static NAME: &'static str = "uutils"; -static VERSION: &'static str = "0.0.1"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); include!(concat!(env!("OUT_DIR"), "/uutils_map.rs")); diff --git a/src/wc/wc.rs b/src/wc/wc.rs index 684afc1f3..50a9f2bc0 100644 --- a/src/wc/wc.rs +++ b/src/wc/wc.rs @@ -70,7 +70,7 @@ struct Result { } static NAME: &'static str = "wc"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub fn uumain(args: Vec) -> i32 { let mut opts = Options::new(); diff --git a/src/whoami/whoami.rs b/src/whoami/whoami.rs index 3e35b22c3..fb5ee278d 100644 --- a/src/whoami/whoami.rs +++ b/src/whoami/whoami.rs @@ -23,7 +23,7 @@ use std::io::Write; mod platform; static NAME: &'static str = "whoami"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub fn uumain(args: Vec) -> i32 { let mut opts = Options::new(); diff --git a/src/yes/yes.rs b/src/yes/yes.rs index fd24b6a4b..4759e2787 100644 --- a/src/yes/yes.rs +++ b/src/yes/yes.rs @@ -21,7 +21,7 @@ use getopts::Options; use std::io::Write; static NAME: &'static str = "yes"; -static VERSION: &'static str = "1.0.0"; +static VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub fn uumain(args: Vec) -> i32 { let mut opts = Options::new();