chore: update cli help message and reamde

This commit is contained in:
sigoden
2022-06-20 19:40:09 +08:00
parent 68139c6263
commit c85ea06785
5 changed files with 72 additions and 64 deletions

View File

@@ -40,13 +40,13 @@ fn app() -> Command<'static> {
Arg::new("path")
.default_value(".")
.allow_invalid_utf8(true)
.help("Path to a root directory for serving files"),
.help("Specific path to serve"),
)
.arg(
Arg::new("path-prefix")
.long("path-prefix")
.value_name("path")
.help("Specify an url path prefix"),
.help("Specify an path prefix"),
)
.arg(
Arg::new("auth")
@@ -94,17 +94,17 @@ fn app() -> Command<'static> {
.arg(
Arg::new("render-index")
.long("render-index")
.help("Render index.html when requesting a directory"),
.help("Serve index.html when requesting a directory, returns 404 if not found index.html"),
)
.arg(
Arg::new("render-try-index")
.long("render-try-index")
.help("Render index.html if it exists when requesting a directory"),
.help("Serve index.html when requesting a directory, returns file listing if not found index.html"),
)
.arg(
Arg::new("render-spa")
.long("render-spa")
.help("Render for single-page application"),
.help("Serve SPA(Single Page Application)"),
)
.arg(
Arg::new("tls-cert")
@@ -124,7 +124,7 @@ pub fn matches() -> ArgMatches {
app().get_matches()
}
#[derive(Debug, Clone)]
#[derive(Debug)]
pub struct Args {
pub addrs: Vec<IpAddr>,
pub port: u16,

View File

@@ -22,12 +22,12 @@ lazy_static! {
};
}
#[derive(Debug, Clone)]
#[derive(Debug)]
pub struct AccessControl {
rules: HashMap<String, PathControl>,
}
#[derive(Debug, Clone)]
#[derive(Debug)]
pub struct PathControl {
readwrite: Account,
readonly: Option<Account>,