Browse Source

adds Example Usage section

master
Jonathan Strong 2 years ago
parent
commit
fd6191e9e3
  1. 2
      Cargo.lock
  2. 27
      README.md
  3. 21
      doc/README.tera.md
  4. 4
      doc/cli-menu.txt
  5. 2
      justfile

2
Cargo.lock generated

@ -1310,7 +1310,7 @@ checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244"
[[package]] [[package]]
name = "registry-backup" name = "registry-backup"
version = "0.2.2" version = "0.2.3"
dependencies = [ dependencies = [
"chrono", "chrono",
"clap", "clap",

27
README.md

@ -7,12 +7,33 @@ Use cases:
- **Backup:** retrieve a registry server's files for backup storage - **Backup:** retrieve a registry server's files for backup storage
- **Export:** pull the files so you can host them at another registry server - **Export:** pull the files so you can host them at another registry server
## Example Usage:
Specify the registry index either as a local path (`--index-path`)...
```console
$ git clone https://github.com/rust-lang/crates.io-index.git
$ registry-backup \
--index-path crates.io-index \
--output-path crates.io-crate-files \
--requests-per-second 10
```
...or as an `--index-url` instead:
```console
$ registry-backup \
--index-url ssh://git@ssh.shipyard.rs/shipyard-rs/crate-index.git \
--output-path shipyard-rs-crate-files \
--requests-per-second 10
```
## Runtime Options ## Runtime Options
```console ```console
$ ./target/release/registry-backup --help $ ./target/release/registry-backup --help
registry-backup 0.2.2 registry-backup 0.2.3
Jonathan Strong <jstrong@shipyard.rs> Jonathan Strong <jstrong@shipyard.rs>
Download all .crate files from a registry server Download all .crate files from a registry server
@ -32,7 +53,7 @@ OPTIONS:
Directory where downloaded .crate files will be saved to [default: output] Directory where downloaded .crate files will be saved to [default: output]
-u, --user-agent <USER_AGENT> -u, --user-agent <USER_AGENT>
Value of user-agent HTTP header [default: registry-backup/v0.2.2] Value of user-agent HTTP header [default: registry-backup/v0.2.3]
--requests-per-second <REQUESTS_PER_SECOND> --requests-per-second <REQUESTS_PER_SECOND>
Requests to registry server will not exceed this rate [default: 25] Requests to registry server will not exceed this rate [default: 25]
@ -116,7 +137,7 @@ The commands that mirror cargo commands (e.g. `just test`) are included for the
This file is generated using a template (`doc/README.tera.md`) rendered using updated outputs of the CLI menu, config sample, and other values. This file is generated using a template (`doc/README.tera.md`) rendered using updated outputs of the CLI menu, config sample, and other values.
This version of `README.md` was generated at `Fri, 09 Sep 2022 02:45:35 +0000` based on git commit `67814b8a`. This version of `README.md` was generated at `Fri, 09 Sep 2022 02:55:22 +0000` based on git commit `1c087e79`.
To (re-)generate the `README.md` file, use the justfile command: To (re-)generate the `README.md` file, use the justfile command:

21
doc/README.tera.md

@ -7,6 +7,27 @@ Use cases:
- **Backup:** retrieve a registry server's files for backup storage - **Backup:** retrieve a registry server's files for backup storage
- **Export:** pull the files so you can host them at another registry server - **Export:** pull the files so you can host them at another registry server
## Example Usage:
Specify the registry index either as a local path (`--index-path`)...
```console
$ git clone https://github.com/rust-lang/crates.io-index.git
$ registry-backup \
--index-path crates.io-index \
--output-path crates.io-crate-files \
--requests-per-second 10
```
...or as an `--index-url` instead:
```console
$ registry-backup \
--index-url ssh://git@ssh.shipyard.rs/shipyard-rs/crate-index.git \
--output-path shipyard-rs-crate-files \
--requests-per-second 10
```
## Runtime Options ## Runtime Options
```console ```console

4
doc/cli-menu.txt

@ -1,4 +1,4 @@
registry-backup 0.2.2 registry-backup 0.2.3
Jonathan Strong <jstrong@shipyard.rs> Jonathan Strong <jstrong@shipyard.rs>
Download all .crate files from a registry server Download all .crate files from a registry server
@ -18,7 +18,7 @@ OPTIONS:
Directory where downloaded .crate files will be saved to [default: output] Directory where downloaded .crate files will be saved to [default: output]
-u, --user-agent <USER_AGENT> -u, --user-agent <USER_AGENT>
Value of user-agent HTTP header [default: registry-backup/v0.2.2] Value of user-agent HTTP header [default: registry-backup/v0.2.3]
--requests-per-second <REQUESTS_PER_SECOND> --requests-per-second <REQUESTS_PER_SECOND>
Requests to registry server will not exceed this rate [default: 25] Requests to registry server will not exceed this rate [default: 25]

2
justfile

@ -47,7 +47,7 @@ get-crate-version:
@cat Cargo.toml | rg '^version =' | tr -d "version = " | tr -d '"' @cat Cargo.toml | rg '^version =' | tr -d "version = " | tr -d '"'
# re-generate README.md and overwrite existing file with output # re-generate README.md and overwrite existing file with output
update-readme: verify-clean-git update-readme:
just generate-readme > README.md just generate-readme > README.md
# re-generate, overwrite, and stage changes # re-generate, overwrite, and stage changes

Loading…
Cancel
Save