diff options
Diffstat (limited to 'src/args.rs')
-rw-r--r-- | src/args.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/args.rs b/src/args.rs index 2e28e30..fe976ed 100644 --- a/src/args.rs +++ b/src/args.rs @@ -27,6 +27,13 @@ struct CLIArgs { #[structopt(name = "PATH", parse(from_os_str))] path: Option<PathBuf>, + /// The name of a directory index file to serve, like "index.html" + /// + /// Normally, when miniserve serves a directory, it creates a listing for that directory. + /// However, if a directory contains this file, miniserve will serve that file instead. + #[structopt(long, parse(from_os_str), name="index_file")] + index: Option<PathBuf>, + /// Port to use #[structopt(short = "p", long = "port", default_value = "8080")] port: u16, @@ -162,6 +169,7 @@ pub fn parse_args() -> crate::MiniserveConfig { no_symlinks: args.no_symlinks, random_route, default_color_scheme, + index: args.index, overwrite_files: args.overwrite_files, file_upload: args.file_upload, } |