From 0304ea92390c06ccbbd7d29a88ecedc9718d72c2 Mon Sep 17 00:00:00 2001 From: boasting-squirrel Date: Wed, 3 Apr 2019 20:07:33 +0200 Subject: Added CLI argument to set default theme --- src/main.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 1a4a68f..79a5db2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -43,6 +43,9 @@ pub struct MiniserveConfig { /// Enable random route generation pub random_route: Option, + + /// Default color scheme + pub default_color_scheme: themes::ColorScheme, } fn main() { @@ -179,6 +182,7 @@ fn configure_app(app: App) -> App { let path = &app.state().path; let no_symlinks = app.state().no_symlinks; let random_route = app.state().random_route.clone(); + let default_color_scheme = app.state().default_color_scheme.clone(); if path.is_file() { None } else { @@ -187,7 +191,13 @@ fn configure_app(app: App) -> App { .expect("Couldn't create path") .show_files_listing() .files_listing_renderer(move |dir, req| { - listing::directory_listing(dir, req, no_symlinks, random_route.clone()) + listing::directory_listing( + dir, + req, + no_symlinks, + random_route.clone(), + default_color_scheme.clone(), + ) }), ) } -- cgit v1.2.3