mirror of
https://github.com/Llewellynvdm/exa.git
synced 2024-11-29 07:03:54 +00:00
Upgrade to latest Rust nightly
- s/syntax/phase - no more boxed array syntax - getopts fail implements Show - option#expect now requires &str
This commit is contained in:
parent
98b759d65d
commit
2bb563d448
4
exa.rs
4
exa.rs
@ -1,6 +1,6 @@
|
|||||||
#![feature(phase)]
|
#![feature(phase)]
|
||||||
extern crate regex;
|
extern crate regex;
|
||||||
#[phase(syntax)] extern crate regex_macros;
|
#[phase(plugin)] extern crate regex_macros;
|
||||||
|
|
||||||
use std::os;
|
use std::os;
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ fn main() {
|
|||||||
let args = os::args();
|
let args = os::args();
|
||||||
|
|
||||||
match Options::getopts(args) {
|
match Options::getopts(args) {
|
||||||
Err(err) => println!("Invalid options:\n{}", err.to_err_msg()),
|
Err(err) => println!("Invalid options:\n{}", err),
|
||||||
Ok(opts) => {
|
Ok(opts) => {
|
||||||
|
|
||||||
// Default to listing the current directory when a target
|
// Default to listing the current directory when a target
|
||||||
|
@ -31,7 +31,7 @@ impl SortField {
|
|||||||
|
|
||||||
impl Options {
|
impl Options {
|
||||||
pub fn getopts(args: Vec<String>) -> Result<Options, getopts::Fail_> {
|
pub fn getopts(args: Vec<String>) -> Result<Options, getopts::Fail_> {
|
||||||
let opts = ~[
|
let opts = [
|
||||||
getopts::optflag("a", "all", "show dot-files"),
|
getopts::optflag("a", "all", "show dot-files"),
|
||||||
getopts::optflag("b", "binary", "use binary prefixes in file sizes"),
|
getopts::optflag("b", "binary", "use binary prefixes in file sizes"),
|
||||||
getopts::optflag("g", "group", "show group as well as user"),
|
getopts::optflag("g", "group", "show group as well as user"),
|
||||||
|
2
sort.rs
2
sort.rs
@ -18,7 +18,7 @@ pub enum SortPart {
|
|||||||
impl SortPart {
|
impl SortPart {
|
||||||
pub fn from_string(is_digit: bool, slice: &str) -> SortPart {
|
pub fn from_string(is_digit: bool, slice: &str) -> SortPart {
|
||||||
if is_digit {
|
if is_digit {
|
||||||
Numeric(from_str::<u64>(slice).expect(slice.to_string()))
|
Numeric(from_str::<u64>(slice).expect(slice))
|
||||||
} else {
|
} else {
|
||||||
Stringular(slice.to_ascii_lower())
|
Stringular(slice.to_ascii_lower())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user