From cc37f0dd8ab642a7cab9c83283d3d6f4a9324eb7 Mon Sep 17 00:00:00 2001 From: asonix Date: Thu, 25 Jun 2020 18:17:05 -0500 Subject: [PATCH] Remove redundant default info, update readme help, add 'check' helper --- README.md | 17 +++++++++-------- docker/dev/root/usr/bin/build | 3 ++- docker/dev/root/usr/bin/check | 5 +++++ docker/dev/root/usr/bin/run | 3 ++- src/config.rs | 2 +- 5 files changed, 19 insertions(+), 11 deletions(-) create mode 100755 docker/dev/root/usr/bin/check diff --git a/README.md b/README.md index 46592c6..dd60923 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ _a simple image hosting service_ ## Usage ### Running ``` -pict-rs 0.1.4 +pict-rs 0.2.0-alpha.2 USAGE: pict-rs [FLAGS] [OPTIONS] --path @@ -15,10 +15,10 @@ FLAGS: -V, --version Prints version information OPTIONS: - -a, --addr The address and port the server binds to. Default: 0.0.0.0:8080 [env: - PICTRS_ADDR=] [default: 0.0.0.0:8080] - -f, --format An optional image format to convert all uploaded files into, supports 'jpg' - and 'png' [env: PICTRS_FORMAT=] + -a, --addr The address and port the server binds to. [env: PICTRS_ADDR=] [default: + 0.0.0.0:8080] + -f, --format An optional image format to convert all uploaded files into, supports 'jpg', + 'png', and 'webp' [env: PICTRS_FORMAT=] -m, --max-file-size Specify the maximum allowed uploaded file size (in Megabytes) [env: PICTRS_MAX_FILE_SIZE=] [default: 40] -p, --path The path to the data directory, e.g. data/ [env: PICTRS_PATH=] @@ -59,8 +59,9 @@ dependencies already present $ git clone https://git.asonix.dog/asonix/pict-rs $ cd pict-rs/docker/dev $ ./dev.sh -$ build -$ run -- -p data/ +$ check # runs cargo check +$ build # runs cargo build +$ run -p data/ ``` Development environments are provided for amd64, arm32v7, and arm64v8. By default `dev.sh` will load into the contianer targetting amd64, but arch arguments can be passed to change the target. @@ -70,7 +71,7 @@ $ build # note: # This command may not work unless qemu-user-static has been configured for your docker instance -$ run -- -p data/ +$ run -p data/ ``` ### API diff --git a/docker/dev/root/usr/bin/build b/docker/dev/root/usr/bin/build index c5ababa..3fd8a11 100755 --- a/docker/dev/root/usr/bin/build +++ b/docker/dev/root/usr/bin/build @@ -1,4 +1,5 @@ #!/usr/bin/env bash -shift +set -xe + cargo build --target=$TARGET diff --git a/docker/dev/root/usr/bin/check b/docker/dev/root/usr/bin/check new file mode 100755 index 0000000..25d8af8 --- /dev/null +++ b/docker/dev/root/usr/bin/check @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -xe + +cargo check --target=$TARGET diff --git a/docker/dev/root/usr/bin/run b/docker/dev/root/usr/bin/run index 4a941ce..15feab0 100755 --- a/docker/dev/root/usr/bin/run +++ b/docker/dev/root/usr/bin/run @@ -1,4 +1,5 @@ #!/usr/bin/env bash -shift +set -xe + cargo run --target=$TARGET -- "$@" diff --git a/src/config.rs b/src/config.rs index eb63bed..e66a351 100644 --- a/src/config.rs +++ b/src/config.rs @@ -14,7 +14,7 @@ pub(crate) struct Config { long, env = "PICTRS_ADDR", default_value = "0.0.0.0:8080", - help = "The address and port the server binds to. Default: 0.0.0.0:8080" + help = "The address and port the server binds to." )] addr: SocketAddr,