mirror of
https://github.com/Llewellynvdm/exa.git
synced 2025-04-08 00:11:51 +00:00
Upgrade to latest Rust
Still missing a few Beta features, but it compiles! - Copy requires Clone - current_dir returns a Path now - num_cpus moved to a crate
This commit is contained in:
parent
8d066994e7
commit
f885568145
95
Cargo.lock
generated
95
Cargo.lock
generated
@ -2,21 +2,22 @@
|
|||||||
name = "exa"
|
name = "exa"
|
||||||
version = "0.2.0"
|
version = "0.2.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ansi_term 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"ansi_term 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"datetime 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
"datetime 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"getopts 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
"getopts 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"git2 0.2.6 (git+https://github.com/alexcrichton/git2-rs.git)",
|
"git2 0.2.8 (git+https://github.com/alexcrichton/git2-rs.git)",
|
||||||
"locale 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"locale 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"natord 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"natord 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"num_cpus 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"number_prefix 0.2.3 (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.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"pad 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"users 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"users 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ansi_term"
|
name = "ansi_term"
|
||||||
version = "0.5.0"
|
version = "0.5.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -31,49 +32,49 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"locale 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"locale 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"pad 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"pad 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"regex 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
|
"regex 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"regex_macros 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
"regex_macros 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gcc"
|
name = "gcc"
|
||||||
version = "0.3.3"
|
version = "0.3.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "getopts"
|
name = "getopts"
|
||||||
version = "0.2.5"
|
version = "0.2.9"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"log 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "git2"
|
name = "git2"
|
||||||
version = "0.2.6"
|
version = "0.2.8"
|
||||||
source = "git+https://github.com/alexcrichton/git2-rs.git#e79e709310196873a4e6a8e5893295ea9d0fab56"
|
source = "git+https://github.com/alexcrichton/git2-rs.git#1f2cb994360df26a7a84c8ed17dd14929ba7dcd7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libc 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libgit2-sys 0.2.7 (git+https://github.com/alexcrichton/git2-rs.git)",
|
"libgit2-sys 0.2.10 (git+https://github.com/alexcrichton/git2-rs.git)",
|
||||||
"url 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
|
"url 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.1.3"
|
version = "0.1.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libgit2-sys"
|
name = "libgit2-sys"
|
||||||
version = "0.2.7"
|
version = "0.2.10"
|
||||||
source = "git+https://github.com/alexcrichton/git2-rs.git#e79e709310196873a4e6a8e5893295ea9d0fab56"
|
source = "git+https://github.com/alexcrichton/git2-rs.git#1f2cb994360df26a7a84c8ed17dd14929ba7dcd7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libssh2-sys 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libssh2-sys 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libz-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libz-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"openssl-sys 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"openssl-sys 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"pkg-config 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"pkg-config 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -86,13 +87,13 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libssh2-sys"
|
name = "libssh2-sys"
|
||||||
version = "0.1.15"
|
version = "0.1.17"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libz-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libz-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"openssl-sys 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"openssl-sys 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"pkg-config 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"pkg-config 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -100,7 +101,7 @@ name = "libz-sys"
|
|||||||
version = "0.1.2"
|
version = "0.1.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"pkg-config 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"pkg-config 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -110,8 +111,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "log"
|
name = "log"
|
||||||
version = "0.2.5"
|
version = "0.3.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"libc 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "matches"
|
name = "matches"
|
||||||
@ -123,6 +127,15 @@ name = "natord"
|
|||||||
version = "1.0.8"
|
version = "1.0.8"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "num_cpus"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"gcc 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"libc 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "number_prefix"
|
name = "number_prefix"
|
||||||
version = "0.2.3"
|
version = "0.2.3"
|
||||||
@ -130,13 +143,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "openssl-sys"
|
name = "openssl-sys"
|
||||||
version = "0.5.2"
|
version = "0.5.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"gcc 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"gcc 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libc 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libressl-pnacl-sys 2.1.4 (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.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"pkg-config 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -146,7 +159,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pkg-config"
|
name = "pkg-config"
|
||||||
version = "0.3.2"
|
version = "0.3.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -156,36 +169,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex"
|
name = "regex"
|
||||||
version = "0.1.21"
|
version = "0.1.26"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex_macros"
|
name = "regex_macros"
|
||||||
version = "0.1.13"
|
version = "0.1.14"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"regex 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
|
"regex 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustc-serialize"
|
name = "rustc-serialize"
|
||||||
version = "0.3.7"
|
version = "0.3.12"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "url"
|
name = "url"
|
||||||
version = "0.2.28"
|
version = "0.2.29"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rustc-serialize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rustc-serialize 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "users"
|
name = "users"
|
||||||
version = "0.3.1"
|
version = "0.3.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@ datetime = "0.1.3"
|
|||||||
getopts = "0.2.1"
|
getopts = "0.2.1"
|
||||||
locale = "0.1.2"
|
locale = "0.1.2"
|
||||||
natord = "1.0.7"
|
natord = "1.0.7"
|
||||||
|
num_cpus = "*"
|
||||||
number_prefix = "0.2.3"
|
number_prefix = "0.2.3"
|
||||||
pad = "0.1.1"
|
pad = "0.1.1"
|
||||||
users = "0.3.1"
|
users = "0.3.1"
|
||||||
|
@ -21,7 +21,7 @@ pub enum Column {
|
|||||||
|
|
||||||
/// Each column can pick its own **Alignment**. Usually, numbers are
|
/// Each column can pick its own **Alignment**. Usually, numbers are
|
||||||
/// right-aligned, and text is left-aligned.
|
/// right-aligned, and text is left-aligned.
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub enum Alignment {
|
pub enum Alignment {
|
||||||
Left, Right,
|
Left, Right,
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ extern "C" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Attributes which can be passed to `Attribute::list_with_flags`
|
/// Attributes which can be passed to `Attribute::list_with_flags`
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub enum ListFlags {
|
pub enum ListFlags {
|
||||||
/// Don't follow symbolic links
|
/// Don't follow symbolic links
|
||||||
NoFollow = XATTR_NOFOLLOW as isize,
|
NoFollow = XATTR_NOFOLLOW as isize,
|
||||||
|
@ -20,7 +20,7 @@ extern "C" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Attributes which can be passed to `Attribute::list_with_flags`
|
/// Attributes which can be passed to `Attribute::list_with_flags`
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub enum FollowSymlinks {
|
pub enum FollowSymlinks {
|
||||||
Yes,
|
Yes,
|
||||||
No
|
No
|
||||||
|
15
src/file.rs
15
src/file.rs
@ -9,7 +9,7 @@ use std::old_io as io;
|
|||||||
use std::old_path::GenericPath;
|
use std::old_path::GenericPath;
|
||||||
use std::old_path::posix::Path;
|
use std::old_path::posix::Path;
|
||||||
use std::ascii::AsciiExt;
|
use std::ascii::AsciiExt;
|
||||||
use std::os::getcwd;
|
use std::env::current_dir;
|
||||||
use unicode::str::UnicodeStr;
|
use unicode::str::UnicodeStr;
|
||||||
|
|
||||||
use ansi_term::{ANSIString, ANSIStrings, Colour, Style};
|
use ansi_term::{ANSIString, ANSIStrings, Colour, Style};
|
||||||
@ -458,10 +458,19 @@ impl<'a> File<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn git_status(&self) -> Cell {
|
fn git_status(&self) -> Cell {
|
||||||
|
use std::os::unix::ffi::OsStrExt;
|
||||||
|
use std::ffi::AsOsStr;
|
||||||
|
|
||||||
let status = match self.dir {
|
let status = match self.dir {
|
||||||
Some(d) => d.git_status(&getcwd().unwrap_or(Path::new(".")).join(&self.path),
|
|
||||||
self.is_directory()),
|
|
||||||
None => GREY.paint("--").to_string(),
|
None => GREY.paint("--").to_string(),
|
||||||
|
Some(d) => {
|
||||||
|
let cwd = match current_dir() {
|
||||||
|
Err(_) => Path::new(".").join(&self.path),
|
||||||
|
Ok(dir) => Path::new(dir.as_os_str().as_bytes()).join(&self.path),
|
||||||
|
};
|
||||||
|
|
||||||
|
d.git_status(&cwd, self.is_directory())
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
Cell { text: status, length: 2 }
|
Cell { text: status, length: 2 }
|
||||||
|
@ -7,7 +7,7 @@ use ansi_term::Style;
|
|||||||
use ansi_term::Style::Plain;
|
use ansi_term::Style::Plain;
|
||||||
use ansi_term::Colour::{Red, Green, Yellow, Blue, Cyan, Fixed};
|
use ansi_term::Colour::{Red, Green, Yellow, Blue, Cyan, Fixed};
|
||||||
|
|
||||||
#[derive(PartialEq, Debug, Copy)]
|
#[derive(PartialEq, Debug)]
|
||||||
pub enum FileType {
|
pub enum FileType {
|
||||||
Normal, Directory, Executable, Immediate, Compiled, Symlink, Special,
|
Normal, Directory, Executable, Immediate, Compiled, Symlink, Special,
|
||||||
Image, Video, Music, Lossless, Compressed, Document, Temp, Crypto,
|
Image, Video, Music, Lossless, Compressed, Document, Temp, Crypto,
|
||||||
|
@ -10,6 +10,7 @@ extern crate datetime;
|
|||||||
extern crate getopts;
|
extern crate getopts;
|
||||||
extern crate locale;
|
extern crate locale;
|
||||||
extern crate natord;
|
extern crate natord;
|
||||||
|
extern crate num_cpus;
|
||||||
extern crate number_prefix;
|
extern crate number_prefix;
|
||||||
extern crate pad;
|
extern crate pad;
|
||||||
extern crate unicode;
|
extern crate unicode;
|
||||||
@ -22,7 +23,6 @@ use std::env;
|
|||||||
use std::old_io::{fs, FileType};
|
use std::old_io::{fs, FileType};
|
||||||
use std::old_path::GenericPath;
|
use std::old_path::GenericPath;
|
||||||
use std::old_path::posix::Path;
|
use std::old_path::posix::Path;
|
||||||
use std::os::num_cpus;
|
|
||||||
use std::sync::mpsc::{channel, sync_channel};
|
use std::sync::mpsc::{channel, sync_channel};
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ impl<'a> Exa<'a> {
|
|||||||
let total_files = files.len();
|
let total_files = files.len();
|
||||||
|
|
||||||
// Denotes the maxinum number of concurrent threads
|
// Denotes the maxinum number of concurrent threads
|
||||||
let (thread_capacity_tx, thread_capacity_rs) = sync_channel(8 * num_cpus());
|
let (thread_capacity_tx, thread_capacity_rs) = sync_channel(8 * num_cpus::get());
|
||||||
|
|
||||||
// Communication between consumer thread and producer threads
|
// Communication between consumer thread and producer threads
|
||||||
enum StatResult<'a> {
|
enum StatResult<'a> {
|
||||||
|
@ -19,14 +19,14 @@ use self::Misfire::*;
|
|||||||
|
|
||||||
/// The *Options* struct represents a parsed version of the user's
|
/// The *Options* struct represents a parsed version of the user's
|
||||||
/// command-line options.
|
/// command-line options.
|
||||||
#[derive(PartialEq, Debug, Copy)]
|
#[derive(PartialEq, Debug, Copy, Clone)]
|
||||||
pub struct Options {
|
pub struct Options {
|
||||||
pub dir_action: DirAction,
|
pub dir_action: DirAction,
|
||||||
pub filter: FileFilter,
|
pub filter: FileFilter,
|
||||||
pub view: View,
|
pub view: View,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(PartialEq, Debug, Copy)]
|
#[derive(PartialEq, Debug, Copy, Clone)]
|
||||||
pub struct FileFilter {
|
pub struct FileFilter {
|
||||||
list_dirs_first: bool,
|
list_dirs_first: bool,
|
||||||
reverse: bool,
|
reverse: bool,
|
||||||
@ -34,7 +34,7 @@ pub struct FileFilter {
|
|||||||
sort_field: SortField,
|
sort_field: SortField,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(PartialEq, Debug, Copy)]
|
#[derive(PartialEq, Debug, Copy, Clone)]
|
||||||
pub enum View {
|
pub enum View {
|
||||||
Details(Details),
|
Details(Details),
|
||||||
Lines,
|
Lines,
|
||||||
@ -160,7 +160,7 @@ impl FileFilter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// User-supplied field to sort by.
|
/// User-supplied field to sort by.
|
||||||
#[derive(PartialEq, Debug, Copy)]
|
#[derive(PartialEq, Debug, Copy, Clone)]
|
||||||
pub enum SortField {
|
pub enum SortField {
|
||||||
Unsorted, Name, Extension, Size, FileInode,
|
Unsorted, Name, Extension, Size, FileInode,
|
||||||
ModifiedDate, AccessedDate, CreatedDate,
|
ModifiedDate, AccessedDate, CreatedDate,
|
||||||
@ -362,7 +362,7 @@ impl TimeType {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(PartialEq, Debug, Copy)]
|
#[derive(PartialEq, Debug, Copy, Clone)]
|
||||||
pub struct TimeTypes {
|
pub struct TimeTypes {
|
||||||
accessed: bool,
|
accessed: bool,
|
||||||
modified: bool,
|
modified: bool,
|
||||||
@ -413,7 +413,7 @@ impl TimeTypes {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// What to do when encountering a directory?
|
/// What to do when encountering a directory?
|
||||||
#[derive(PartialEq, Debug, Copy)]
|
#[derive(PartialEq, Debug, Copy, Clone)]
|
||||||
pub enum DirAction {
|
pub enum DirAction {
|
||||||
AsFile,
|
AsFile,
|
||||||
List,
|
List,
|
||||||
@ -458,7 +458,7 @@ impl DirAction {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(PartialEq, Debug, Copy)]
|
#[derive(PartialEq, Debug, Copy, Clone)]
|
||||||
pub struct RecurseOptions {
|
pub struct RecurseOptions {
|
||||||
pub tree: bool,
|
pub tree: bool,
|
||||||
pub max_depth: Option<usize>,
|
pub max_depth: Option<usize>,
|
||||||
@ -492,7 +492,7 @@ impl RecurseOptions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(PartialEq, Copy, Debug)]
|
#[derive(PartialEq, Copy, Clone, Debug)]
|
||||||
pub struct Columns {
|
pub struct Columns {
|
||||||
size_format: SizeFormat,
|
size_format: SizeFormat,
|
||||||
time_types: TimeTypes,
|
time_types: TimeTypes,
|
||||||
|
@ -19,7 +19,7 @@ use ansi_term::Style::Plain;
|
|||||||
///
|
///
|
||||||
/// Almost all the heavy lifting is done in a Table object, which handles the
|
/// Almost all the heavy lifting is done in a Table object, which handles the
|
||||||
/// columns for each row.
|
/// columns for each row.
|
||||||
#[derive(PartialEq, Debug, Copy)]
|
#[derive(PartialEq, Debug, Copy, Clone)]
|
||||||
pub struct Details {
|
pub struct Details {
|
||||||
|
|
||||||
/// A Columns object that says which columns should be included in the
|
/// A Columns object that says which columns should be included in the
|
||||||
|
@ -5,7 +5,7 @@ use super::lines::lines_view;
|
|||||||
use std::cmp::max;
|
use std::cmp::max;
|
||||||
use std::iter::{AdditiveIterator, repeat};
|
use std::iter::{AdditiveIterator, repeat};
|
||||||
|
|
||||||
#[derive(PartialEq, Debug, Copy)]
|
#[derive(PartialEq, Debug, Copy, Clone)]
|
||||||
pub struct Grid {
|
pub struct Grid {
|
||||||
pub across: bool,
|
pub across: bool,
|
||||||
pub console_width: usize,
|
pub console_width: usize,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user