diff options
author | boasting-squirrel <boasting.squirrel@gmail.com> | 2019-04-03 18:07:33 +0000 |
---|---|---|
committer | boasting-squirrel <boasting.squirrel@gmail.com> | 2019-04-03 18:07:33 +0000 |
commit | 0304ea92390c06ccbbd7d29a88ecedc9718d72c2 (patch) | |
tree | 670c3b12843187e042ca3981960b0cf56230985e /src/main.rs | |
parent | Added light theme (diff) | |
download | miniserve-0304ea92390c06ccbbd7d29a88ecedc9718d72c2.tar.gz miniserve-0304ea92390c06ccbbd7d29a88ecedc9718d72c2.zip |
Added CLI argument to set default theme
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 12 |
1 files changed, 11 insertions, 1 deletions
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<String>, + + /// Default color scheme + pub default_color_scheme: themes::ColorScheme, } fn main() { @@ -179,6 +182,7 @@ fn configure_app(app: App<MiniserveConfig>) -> App<MiniserveConfig> { 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<MiniserveConfig>) -> App<MiniserveConfig> { .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(), + ) }), ) } |