Upgrade to latest Rust

- Update package versions
- locale::default -> locale::english
- Argument handling changes
This commit is contained in:
Ben S 2015-02-12 22:33:01 +00:00
parent 2906b8676a
commit ec51867a53
5 changed files with 25 additions and 29 deletions

34
Cargo.lock generated
View File

@ -2,11 +2,11 @@
name = "exa"
version = "0.1.0"
dependencies = [
"ansi_term 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
"datetime 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"getopts 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"ansi_term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"datetime 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"getopts 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"git2 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"locale 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"locale 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"natord 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)",
"number_prefix 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"pad 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -15,7 +15,7 @@ dependencies = [
[[package]]
name = "ansi_term"
version = "0.4.5"
version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"regex 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
@ -29,10 +29,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "datetime"
version = "0.1.3"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"locale 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"locale 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"pad 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
"regex_macros 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
@ -45,7 +45,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "getopts"
version = "0.2.3"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"log 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
@ -57,7 +57,7 @@ version = "0.1.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libgit2-sys 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
"libgit2-sys 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -68,13 +68,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "libgit2-sys"
version = "0.1.12"
version = "0.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libssh2-sys 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"libz-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -91,7 +91,7 @@ version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libz-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -105,7 +105,7 @@ dependencies = [
[[package]]
name = "locale"
version = "0.1.2"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
@ -130,12 +130,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "openssl-sys"
version = "0.3.3"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"gcc 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"libressl-pnacl-sys 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -150,7 +150,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "pkg-config"
version = "0.2.0"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]

View File

@ -7,7 +7,7 @@ authors = [ "ogham@bsago.me" ]
name = "exa"
[dependencies]
ansi_term = "0.4.5"
ansi_term = "0.4.6"
datetime = "0.1.3"
#datetime_macros = "0.1.2"
getopts = "0.2.1"

View File

@ -292,7 +292,7 @@ impl<'a> File<'a> {
match result {
Standalone(bytes) => Cell::paint(Green.bold(), &*bytes.to_string()),
Prefixed(prefix, n) => {
let number = if n < 10f64 { locale.format_float(n, 1, false) } else { locale.format_int(n as isize) };
let number = if n < 10f64 { locale.format_float(n, 1) } else { locale.format_int(n as isize) };
let symbol = prefix.symbol();
Cell {

View File

@ -1,4 +1,4 @@
#![feature(collections, core, env, io, libc, os, path, plugin, std_misc)]
#![feature(collections, core, env, io, libc, path, plugin, std_misc)]
extern crate ansi_term;
extern crate datetime;
@ -138,7 +138,7 @@ impl<'a> Exa<'a> {
}
fn main() {
let args = args();
let args: Vec<String> = env::args().collect();
match Options::getopts(args.tail()) {
Ok((options, paths)) => {
@ -153,7 +153,3 @@ fn main() {
},
};
}
fn args() -> Vec<String> {
env::args().map(|arg| arg.to_string_lossy().into_owned()).collect()
}

View File

@ -115,15 +115,15 @@ pub struct UserLocale {
impl UserLocale {
pub fn new() -> UserLocale {
UserLocale {
time: locale::Time::load_user_locale().unwrap_or_else(|_| locale::Time::default()),
numeric: locale::Numeric::load_user_locale().unwrap_or_else(|_| locale::Numeric::default()),
time: locale::Time::load_user_locale().unwrap_or_else(|_| locale::Time::english()),
numeric: locale::Numeric::load_user_locale().unwrap_or_else(|_| locale::Numeric::english()),
}
}
pub fn default() -> UserLocale {
UserLocale {
time: locale::Time::default(),
numeric: locale::Numeric::default(),
time: locale::Time::english(),
numeric: locale::Numeric::english(),
}
}
}