Compare commits
1 Commits
6102b1b8c8
...
ad00301ac9
| Author | SHA1 | Date | |
|---|---|---|---|
| ad00301ac9 |
@@ -5,7 +5,9 @@ use std::process::ExitCode;
|
||||
use xatu::{Report, SourceFile};
|
||||
|
||||
fn main() -> ExitCode {
|
||||
match analyze(Args::parse()) {
|
||||
let args = Args::parse();
|
||||
|
||||
match analyze(args) {
|
||||
Ok(report) if report.is_clean() => {
|
||||
println!("No findings.");
|
||||
ExitCode::SUCCESS
|
||||
@@ -21,6 +23,12 @@ fn main() -> ExitCode {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Parser)]
|
||||
struct Args {
|
||||
#[arg(value_name = "PATH", default_value = ".")]
|
||||
paths: Vec<PathBuf>,
|
||||
}
|
||||
|
||||
fn analyze(args: Args) -> status::Result<Report> {
|
||||
let paths: Vec<PathBuf> = args
|
||||
.paths
|
||||
@@ -39,12 +47,6 @@ fn analyze(args: Args) -> status::Result<Report> {
|
||||
xatu::future_sight(files)
|
||||
}
|
||||
|
||||
#[derive(Debug, Parser)]
|
||||
struct Args {
|
||||
#[arg(value_name = "PATH", default_value = ".")]
|
||||
paths: Vec<PathBuf>,
|
||||
}
|
||||
|
||||
fn collect_source_files(path: &Path) -> status::Result<Vec<SourceFile>> {
|
||||
let metadata = std::fs::symlink_metadata(path)
|
||||
.with_context(|| format!("failed to read metadata for {}", path.display()))?;
|
||||
|
||||
Reference in New Issue
Block a user