From 9857f26bdd4e9e87b13a9755b1e00569e9459238 Mon Sep 17 00:00:00 2001 From: boasting-squirrel Date: Fri, 8 Mar 2019 19:59:59 +0100 Subject: Download folder as a tar working --- src/main.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index b15088c..9f2cacf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,5 @@ #![feature(proc_macro_hygiene)] +#![feature(try_trait)] use actix_web::{fs, middleware, server, App}; use clap::crate_version; @@ -9,6 +10,7 @@ use std::thread; use std::time::Duration; use yansi::{Color, Paint}; +mod archive; mod args; mod auth; mod listing; -- cgit v1.2.3 From d56804a37f0c44160f27195853d578d8f85ddba1 Mon Sep 17 00:00:00 2001 From: boasting-squirrel Date: Tue, 12 Mar 2019 00:25:02 +0100 Subject: Changed Info: to info: to be consistent --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 9f2cacf..1bddd6d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -121,7 +121,7 @@ fn main() { version = crate_version!() ); if !miniserve_config.path_explicitly_chosen { - println!("{info} miniserve has been invoked without an explicit path so it will serve the current directory.", info=Color::Blue.paint("Info:").bold()); + println!("{info} miniserve has been invoked without an explicit path so it will serve the current directory.", info=Color::Blue.paint("info:").bold()); println!( " Invoke with -h|--help to see options or invoke as `miniserve .` to hide this advice." ); -- cgit v1.2.3 From aeb51dcf43665741a3438360151a4424e9b243e0 Mon Sep 17 00:00:00 2001 From: boasting-squirrel Date: Tue, 12 Mar 2019 00:25:56 +0100 Subject: Started to add helpful messages for errors which could occur during archiving --- src/main.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 1bddd6d..59389b1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,6 +15,7 @@ mod args; mod auth; mod listing; mod renderer; +mod errors; #[derive(Clone, Debug)] /// Configuration of the Miniserve application -- cgit v1.2.3 From 122a949ec49f84a49e7a5bec657a93a65faadce1 Mon Sep 17 00:00:00 2001 From: boasting-squirrel Date: Tue, 12 Mar 2019 20:16:45 +0100 Subject: Better error messages for invalid path --- src/main.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 59389b1..260551c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,4 @@ #![feature(proc_macro_hygiene)] -#![feature(try_trait)] use actix_web::{fs, middleware, server, App}; use clap::crate_version; @@ -13,9 +12,9 @@ use yansi::{Color, Paint}; mod archive; mod args; mod auth; +mod errors; mod listing; mod renderer; -mod errors; #[derive(Clone, Debug)] /// Configuration of the Miniserve application -- cgit v1.2.3 From 17ef61a126e81c9ecfd1ebdd89537e854a06cae6 Mon Sep 17 00:00:00 2001 From: boasting-squirrel Date: Wed, 13 Mar 2019 19:30:54 +0100 Subject: Switched to standard Rust logging system --- src/main.rs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 260551c..f662a73 100644 --- a/src/main.rs +++ b/src/main.rs @@ -50,6 +50,13 @@ fn main() { } let miniserve_config = args::parse_args(); + + let _ = if miniserve_config.verbose { + TermLogger::init(LevelFilter::Info, Config::default()) + } else { + TermLogger::init(LevelFilter::Error, Config::default()) + }; + if miniserve_config.no_symlinks && miniserve_config .path @@ -58,16 +65,10 @@ fn main() { .file_type() .is_symlink() { - println!( - "{error} The no-symlinks option cannot be used with a symlink path", - error = Paint::red("error:").bold(), - ); + log::error!("The no-symlinks option cannot be used with a symlink path"); return; } - if miniserve_config.verbose { - let _ = TermLogger::init(LevelFilter::Info, Config::default()); - } let sys = actix::System::new("miniserve"); let inside_config = miniserve_config.clone(); @@ -121,7 +122,7 @@ fn main() { version = crate_version!() ); if !miniserve_config.path_explicitly_chosen { - println!("{info} miniserve has been invoked without an explicit path so it will serve the current directory.", info=Color::Blue.paint("info:").bold()); + println!("{warning} miniserve has been invoked without an explicit path so it will serve the current directory.", warning=Color::RGB(255, 192, 0).paint("Notice:").bold()); println!( " Invoke with -h|--help to see options or invoke as `miniserve .` to hide this advice." ); @@ -166,7 +167,7 @@ fn main() { path = Color::Yellow.paint(path_string).bold(), addresses = addresses, ); - println!("Quit by pressing CTRL-C"); + println!("\nQuit by pressing CTRL-C"); let _ = sys.run(); } -- cgit v1.2.3