switch to cargo version numbers

This commit is contained in:
Michael Gehring 2015-11-25 10:52:10 +01:00
parent 9365e100d9
commit ca16e66a55
70 changed files with 71 additions and 71 deletions

View file

@ -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<Box<Read+'static>>;

View file

@ -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<String>) -> i32 {
//

View file

@ -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<String>) -> i32 {
let mut opts = Options::new();

View file

@ -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<String>) -> i32 {
let mut opts = Options::new();

View file

@ -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<String>) -> i32 {
let mut opts = Options::new();

View file

@ -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 {

View file

@ -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();

View file

@ -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<String>) -> i32 {
let mut opts = Options::new();

View file

@ -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<String>,

View file

@ -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<String>) -> i32 {
let mut opts = getopts::Options::new();

View file

@ -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,

View file

@ -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 {

2
src/env/env.rs vendored
View file

@ -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,

View file

@ -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;

View file

@ -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<String>) -> i32 {
// For expr utility we do not want getopts.

View file

@ -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 {

View file

@ -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<Box<Read+'static>>;
pub struct FmtOptions {

View file

@ -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<String>) -> i32 {
let (args, obs_width) = handle_obsolete(&args[..]);

View file

@ -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<String>) -> i32 {
let mut opts = getopts::Options::new();

View file

@ -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 {

View file

@ -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),

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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<String>) -> i32 {
let mut opts = getopts::Options::new();

View file

@ -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,

View file

@ -37,7 +37,7 @@ fn get_userlogin() -> Option<String> {
}
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<String>) -> i32 {
//

View file

@ -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

View file

@ -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<String>) -> i32 {
let mut opts = getopts::Options::new();

View file

@ -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,

View file

@ -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;

View file

@ -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.

View file

@ -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 {

View file

@ -19,7 +19,7 @@ use std::io::Write;
use std::env;
static NAME: &'static str = "nproc";
static VERSION : &'static str = "0.0.0";
static VERSION: &'static str = env!("CARGO_PKG_VERSION");
pub fn uumain(args: Vec<String>) -> i32 {
let mut opts = getopts::Options::new();

View file

@ -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<String>) -> i32 {
let mut opts = getopts::Options::new();

View file

@ -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<String>) -> i32 {
let mut opts = getopts::Options::new();

View file

@ -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 {

View file

@ -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<String>) -> i32 {
let mut opts = getopts::Options::new();

View file

@ -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<String>) -> i32 {
let mut opts = getopts::Options::new();

View file

@ -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<String>) -> i32 {
let mut opts = getopts::Options::new();

View file

@ -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<String>) -> i32 {
let mut opts = getopts::Options::new();

View file

@ -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<String>) -> i32 {
// TODO: make getopts support -R in addition to -r

View file

@ -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<String>) -> i32 {
let mut opts = getopts::Options::new();

View file

@ -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 {

View file

@ -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<String>) -> i32 {
let mut opts = getopts::Options::new();

View file

@ -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<String>) -> i32 {
let mut opts = getopts::Options::new();

View file

@ -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 = ',';

View file

@ -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<String>) -> i32 {
let mut opts = getopts::Options::new();

View file

@ -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 {

View file

@ -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<Read>) -> (usize, u16) {
let mut buf = [0; 1024];

View file

@ -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 {

View file

@ -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<String>) -> i32 {
let mut opts = getopts::Options::new();

View file

@ -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<String>) -> i32 {
let mut beginning = false;

View file

@ -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<String>) -> i32 {
match options(&args).and_then(exec) {

View file

@ -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;

View file

@ -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

View file

@ -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) {

View file

@ -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<String>) -> i32 {
let mut opts = getopts::Options::new();

View file

@ -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<String>) -> i32 {
let mut opts = getopts::Options::new();

View file

@ -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<String>) -> i32 {
let mut opts = getopts::Options::new();

View file

@ -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<String>) -> i32 {
let mut opts = getopts::Options::new();

View file

@ -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;

View file

@ -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,

View file

@ -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<String>) -> i32 {
let mut opts = Options::new();

View file

@ -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 {

View file

@ -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<String>) -> i32 {
let mut opts = Options::new();

View file

@ -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"));

View file

@ -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<String>) -> i32 {
let mut opts = Options::new();

View file

@ -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<String>) -> i32 {
let mut opts = Options::new();

View file

@ -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<String>) -> i32 {
let mut opts = Options::new();