-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.rs
More file actions
43 lines (35 loc) · 1.26 KB
/
Copy pathmain.rs
File metadata and controls
43 lines (35 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#[macro_use]
extern crate log;
extern crate regex;
use structopt::StructOpt;
mod cli;
mod file_utilities;
mod model;
mod regex_utilities;
mod reporter;
mod unreferenced_files;
const ERROR_EXIT_CODE: i32 = 1;
fn main() {
env_logger::init();
let arguments = cli::Arguments::from_args();
debug!("The command line arguments provided are {:?}.", arguments);
let search_for_relative_path = !arguments.only_file_name && !arguments.only_file_stem;
let search_for_file_name = !arguments.only_relative_path && !arguments.only_file_stem;
let search_for_file_stem = !arguments.only_relative_path && !arguments.only_file_name;
let searching_for = crate::model::file_path_variants::get_file_path_variants(
file_utilities::get_path(&arguments.from),
arguments.from_ignore_file_regex,
);
let searching = crate::model::raw_file::get_raw_files(
file_utilities::get_path(&arguments.search),
arguments.search_ignore_file_regex,
);
let unreferenced_files = crate::unreferenced_files::get_unreferenced_files(
searching_for,
searching,
search_for_relative_path,
search_for_file_name,
search_for_file_stem,
);
crate::reporter::print(unreferenced_files, arguments.print_full_path);
}