diff options
author | Sven-Hendrik Haase <svenstaro@gmail.com> | 2021-03-28 19:28:20 +0000 |
---|---|---|
committer | Sven-Hendrik Haase <svenstaro@gmail.com> | 2021-03-28 19:28:20 +0000 |
commit | dfe2b2460c33794ca91cf614cd4ead1382a1199a (patch) | |
tree | 80da9efc3b2d30f3939898abae43d591d5ca448e /src | |
parent | Print supported shells for completions in help command (diff) | |
download | miniserve-dfe2b2460c33794ca91cf614cd4ead1382a1199a.tar.gz miniserve-dfe2b2460c33794ca91cf614cd4ead1382a1199a.zip |
Better message for when provided index file doesn't exist
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs index a6410a6..8f29dc6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,6 +12,7 @@ use actix_web::{ use actix_web::{middleware, App, HttpRequest, HttpResponse}; use actix_web_httpauth::middleware::HttpAuthentication; use http::header::HeaderMap; +use log::error; use structopt::clap::crate_version; use structopt::StructOpt; use yansi::{Color, Paint}; @@ -251,9 +252,9 @@ async fn run(miniserve_config: MiniserveConfig) -> Result<(), ContextualError> { if let Some(index_path) = &miniserve_config.index { let has_index: std::path::PathBuf = [&canon_path, index_path].iter().collect(); if !has_index.exists() { - println!( - "{warning} The provided index file could not be found.", - warning = Color::RGB(255, 192, 0).paint("Notice:").bold() + error!( + "The file '{}' provided for option --index could not be found.", + index_path.to_string_lossy() ); } } |