From cfe394f481127c2aff6a11e31139968130ef2b8e Mon Sep 17 00:00:00 2001 From: Jose Quintana Date: Fri, 20 Dec 2019 22:29:48 +0100 Subject: [PATCH] docs: add cli options --- README.md | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 30b19d4..62bd8fe 100644 --- a/README.md +++ b/README.md @@ -12,14 +12,13 @@ - Suitable for small [GNU/Linux Docker containers](https://hub.docker.com/r/joseluisq/static-web-server). It's a fully __1.4MB__ static binary thanks to [Rust and Musl libc](https://doc.rust-lang.org/edition-guide/rust-2018/platform-and-target-support/musl-support-for-fully-static-binaries.html). - Gzip compression by default. - Cache control headers included. -- Configurable via environment variables. +- Configurable via environment variables or CLI arguments. - Lightweight logging support. - Scratch and [latest Alpine Linux](https://hub.docker.com/_/alpine) Docker images available. ## Missing features - TLS support -- CLI flags setup PRs welcome! @@ -35,6 +34,25 @@ Server is configured either via environment variables: Or command line arguments listed with `cargo run -- -h`. +```sh +static-web-server 1.0.0 + +USAGE: + static-web-server [OPTIONS] + +FLAGS: + -h, --help Prints help information + -V, --version Prints version information + +OPTIONS: + --assets Assets directory path for add cache headers functionality [env: SERVER_ASSETS=] [default: + ./assets] + --host Host address (E.g 127.0.0.1) [env: SERVER_HOST=] [default: [::]] + --name Name for server [env: SERVER_NAME=] [default: my-static-server] + --port Host port [env: SERVER_PORT=] [default: 80] + --root Root directory path of static files [env: SERVER_ROOT=] +``` + ## Docker stack Example using [Traefik proxy](https://traefik.io/): -- libgit2 1.7.2