chore: update args help message and readme

This commit is contained in:
sigoden 2022-06-25 09:57:58 +08:00
parent eb7a536a3f
commit 9cfeee0df0
2 changed files with 12 additions and 12 deletions

View file

@ -52,7 +52,7 @@ OPTIONS:
-b, --bind <addr>... Specify bind address -b, --bind <addr>... Specify bind address
-p, --port <port> Specify port to listen on [default: 5000] -p, --port <port> Specify port to listen on [default: 5000]
--path-prefix <path> Specify an path prefix --path-prefix <path> Specify an path prefix
--hidden <names> Comma-separated list of names to hide from directory listings --hidden <value> Hide directories from directory listings, separated by `,`
-a, --auth <rule>... Add auth for path -a, --auth <rule>... Add auth for path
--auth-method <value> Select auth method [default: digest] [possible values: basic, digest] --auth-method <value> Select auth method [default: digest] [possible values: basic, digest]
-A, --allow-all Allow all operations -A, --allow-all Allow all operations
@ -126,7 +126,7 @@ Listen on a specific port
dufs -p 80 dufs -p 80
``` ```
Hide folders from directory listing Hide directories from directory listings
``` ```
dufs --hidden .git,.DS_Store dufs --hidden .git,.DS_Store
@ -168,23 +168,23 @@ curl -X DELETE http://127.0.0.1:5000/path-to-file
Dufs supports path level access control. You can control who can do what on which path with `--auth`/`-a`. Dufs supports path level access control. You can control who can do what on which path with `--auth`/`-a`.
``` ```
dufs -a <path>@<readwrite>[@<readonly>] dufs -a <path>@<readwrite>[@<readonly>|@*]
``` ```
- `<path>`: Path to protected - `<path>`: Protected url path
- `<readwrite>`: Account with readwrite permission, required - `<readwrite>`: Account with upload/delete/view/download permission, required
- `<readonly>`: Account with readonly permission, optional - `<readonly>`: Account with view/download permission, optional
> `<readonly>` can be `*` means `<path>` is public, everyone can access/download it. > `*` means `<path>` is public, everyone can view/download it.
For example: For example:
``` ```
dufs -a /@admin:pass@* -a /ui@designer:pass1 -A dufs -a /@admin:pass@* -a /ui@designer:pass1 -A
``` ```
- All files/folders are public to access/download. - All files/folders are public to view/download.
- Account `admin:pass` can upload/delete/download any files/folders. - Account `admin:pass` can upload/delete/view/download any files/folders.
- Account `designer:pass1` can upload/delete/download any files/folders in the `ui` folder. - Account `designer:pass1` can upload/delete/view/download any files/folders in the `ui` folder.
## License ## License

View file

@ -51,8 +51,8 @@ fn app() -> Command<'static> {
.arg( .arg(
Arg::new("hidden") Arg::new("hidden")
.long("hidden") .long("hidden")
.help("Comma-separated list of names to hide from directory listings") .help("Hide directories from directory listings, separated by `,`")
.value_name("names"), .value_name("value"),
) )
.arg( .arg(
Arg::new("auth") Arg::new("auth")