mirror of
https://github.com/Llewellynvdm/exa.git
synced 2024-11-29 23:23:53 +00:00
It's hardly worth giving Exa its own constructor
This commit is contained in:
parent
83f05ffb3c
commit
a14f1d82f0
@ -39,17 +39,11 @@ mod output;
|
|||||||
mod term;
|
mod term;
|
||||||
|
|
||||||
|
|
||||||
#[cfg(not(test))]
|
|
||||||
struct Exa {
|
struct Exa {
|
||||||
options: Options,
|
options: Options,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(test))]
|
|
||||||
impl Exa {
|
impl Exa {
|
||||||
fn new(options: Options) -> Exa {
|
|
||||||
Exa { options: options }
|
|
||||||
}
|
|
||||||
|
|
||||||
fn run(&mut self, args_file_names: &[String]) {
|
fn run(&mut self, args_file_names: &[String]) {
|
||||||
let mut files = Vec::new();
|
let mut files = Vec::new();
|
||||||
let mut dirs = Vec::new();
|
let mut dirs = Vec::new();
|
||||||
@ -145,13 +139,12 @@ impl Exa {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#[cfg(not(test))]
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let args: Vec<String> = env::args().skip(1).collect();
|
let args: Vec<String> = env::args().skip(1).collect();
|
||||||
|
|
||||||
match Options::getopts(&args) {
|
match Options::getopts(&args) {
|
||||||
Ok((options, paths)) => {
|
Ok((options, paths)) => {
|
||||||
let mut exa = Exa::new(options);
|
let mut exa = Exa { options: options };
|
||||||
exa.run(&paths);
|
exa.run(&paths);
|
||||||
},
|
},
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user