Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(book): update CLI section #6097

Merged
merged 3 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions book/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
- [`reth debug merkle`](./cli/reth/debug/merkle.md)
- [`reth debug in-memory-merkle`](./cli/reth/debug/in-memory-merkle.md)
- [`reth debug build-block`](./cli/reth/debug/build-block.md)
- [`reth debug replay-engine`](./cli/reth/debug/replay-engine.md)
- [`reth recover`](./cli/reth/recover.md)
- [`reth recover storage-tries`](./cli/reth/recover/storage-tries.md)
- [Developers](./developers/developers.md) <!-- CLI_REFERENCE END -->
Expand Down
1 change: 1 addition & 0 deletions book/cli/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
- [`reth debug merkle`](./reth/debug/merkle.md)
- [`reth debug in-memory-merkle`](./reth/debug/in-memory-merkle.md)
- [`reth debug build-block`](./reth/debug/build-block.md)
- [`reth debug replay-engine`](./reth/debug/replay-engine.md)
- [`reth recover`](./reth/recover.md)
- [`reth recover storage-tries`](./reth/recover/storage-tries.md)

6 changes: 4 additions & 2 deletions book/cli/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,10 @@ def preprocess_help(s: str):
"""Preprocesses the help output of a command."""
# Remove the user-specific paths.
s = re.sub(r"default: /.*/reth", "default: <CACHE_DIR>", s)
# Remove the commit SHA.
s = re.sub(r"-[0-9A-Fa-f]{6,10}/", "-<SHA>/", s)
# Remove the commit SHA and target architecture triple
s = re.sub(r"default: reth/.*-[0-9A-Fa-f]{6,10}/\w+-\w*-\w+", "default: reth/<VERSION>-<SHA>/<ARCH>", s)
# Remove the OS
s = re.sub(r"default: reth/.*/\w+", "default: reth/<VERSION>/<OS>", s)

return s

Expand Down
35 changes: 30 additions & 5 deletions book/cli/reth.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,36 @@ Options:
Print version

Logging:
--log.stdout.format <FORMAT>
The format to use for logs written to stdout

[default: terminal]

Possible values:
- json: Represents JSON formatting for logs. This format outputs log records as JSON objects, making it suitable for structured logging
- log-fmt: Represents logfmt (key=value) formatting for logs. This format is concise and human-readable, typically used in command-line applications
- terminal: Represents terminal-friendly formatting for logs

--log.stdout.filter <FILTER>
The filter to use for logs written to stdout

[default: info]

--log.file.format <FORMAT>
The format to use for logs written to the log file

[default: terminal]

Possible values:
- json: Represents JSON formatting for logs. This format outputs log records as JSON objects, making it suitable for structured logging
- log-fmt: Represents logfmt (key=value) formatting for logs. This format is concise and human-readable, typically used in command-line applications
- terminal: Represents terminal-friendly formatting for logs

--log.file.filter <FILTER>
The filter to use for logs written to the log file

[default: debug]

--log.file.directory <PATH>
The path to put log files in

Expand All @@ -62,11 +92,6 @@ Logging:

[default: 5]

--log.file.filter <FILTER>
The filter to use for logs written to the log file

[default: debug]

--log.journald
Write logs to journald

Expand Down
37 changes: 31 additions & 6 deletions book/cli/reth/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Write config to stdout

```text
```bash
$ reth config --help
Usage: reth config [OPTIONS]

Expand Down Expand Up @@ -37,6 +37,36 @@ Options:
Print help (see a summary with '-h')

Logging:
--log.stdout.format <FORMAT>
The format to use for logs written to stdout

[default: terminal]

Possible values:
- json: Represents JSON formatting for logs. This format outputs log records as JSON objects, making it suitable for structured logging
- log-fmt: Represents logfmt (key=value) formatting for logs. This format is concise and human-readable, typically used in command-line applications
- terminal: Represents terminal-friendly formatting for logs

--log.stdout.filter <FILTER>
The filter to use for logs written to stdout

[default: info]

--log.file.format <FORMAT>
The format to use for logs written to the log file

[default: terminal]

Possible values:
- json: Represents JSON formatting for logs. This format outputs log records as JSON objects, making it suitable for structured logging
- log-fmt: Represents logfmt (key=value) formatting for logs. This format is concise and human-readable, typically used in command-line applications
- terminal: Represents terminal-friendly formatting for logs

--log.file.filter <FILTER>
The filter to use for logs written to the log file

[default: debug]

--log.file.directory <PATH>
The path to put log files in

Expand All @@ -52,11 +82,6 @@ Logging:

[default: 5]

--log.file.filter <FILTER>
The filter to use for logs written to the log file

[default: debug]

--log.journald
Write logs to journald

Expand Down
37 changes: 31 additions & 6 deletions book/cli/reth/db.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Database debugging utilities

```text
```bash
$ reth db --help
Usage: reth db [OPTIONS] <COMMAND>

Expand Down Expand Up @@ -68,6 +68,36 @@ Database:
- extra: Enables logging for extra debug-level messages

Logging:
--log.stdout.format <FORMAT>
The format to use for logs written to stdout

[default: terminal]

Possible values:
- json: Represents JSON formatting for logs. This format outputs log records as JSON objects, making it suitable for structured logging
- log-fmt: Represents logfmt (key=value) formatting for logs. This format is concise and human-readable, typically used in command-line applications
- terminal: Represents terminal-friendly formatting for logs

--log.stdout.filter <FILTER>
The filter to use for logs written to stdout

[default: info]

--log.file.format <FORMAT>
The format to use for logs written to the log file

[default: terminal]

Possible values:
- json: Represents JSON formatting for logs. This format outputs log records as JSON objects, making it suitable for structured logging
- log-fmt: Represents logfmt (key=value) formatting for logs. This format is concise and human-readable, typically used in command-line applications
- terminal: Represents terminal-friendly formatting for logs

--log.file.filter <FILTER>
The filter to use for logs written to the log file

[default: debug]

--log.file.directory <PATH>
The path to put log files in

Expand All @@ -83,11 +113,6 @@ Logging:

[default: 5]

--log.file.filter <FILTER>
The filter to use for logs written to the log file

[default: debug]

--log.journald
Write logs to journald

Expand Down
37 changes: 31 additions & 6 deletions book/cli/reth/db/clear.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Deletes all table entries

```text
```bash
$ reth db clear --help
Usage: reth db clear [OPTIONS] <TABLE>

Expand Down Expand Up @@ -46,6 +46,36 @@ Options:
Print help (see a summary with '-h')

Logging:
--log.stdout.format <FORMAT>
The format to use for logs written to stdout

[default: terminal]

Possible values:
- json: Represents JSON formatting for logs. This format outputs log records as JSON objects, making it suitable for structured logging
- log-fmt: Represents logfmt (key=value) formatting for logs. This format is concise and human-readable, typically used in command-line applications
- terminal: Represents terminal-friendly formatting for logs

--log.stdout.filter <FILTER>
The filter to use for logs written to stdout

[default: info]

--log.file.format <FORMAT>
The format to use for logs written to the log file

[default: terminal]

Possible values:
- json: Represents JSON formatting for logs. This format outputs log records as JSON objects, making it suitable for structured logging
- log-fmt: Represents logfmt (key=value) formatting for logs. This format is concise and human-readable, typically used in command-line applications
- terminal: Represents terminal-friendly formatting for logs

--log.file.filter <FILTER>
The filter to use for logs written to the log file

[default: debug]

--log.file.directory <PATH>
The path to put log files in

Expand All @@ -61,11 +91,6 @@ Logging:

[default: 5]

--log.file.filter <FILTER>
The filter to use for logs written to the log file

[default: debug]

--log.journald
Write logs to journald

Expand Down
37 changes: 31 additions & 6 deletions book/cli/reth/db/diff.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Create a diff between two database tables or two entire databases

```text
```bash
$ reth db diff --help
Usage: reth db diff [OPTIONS] --secondary-datadir <SECONDARY_DATADIR> --output <OUTPUT>

Expand Down Expand Up @@ -65,6 +65,36 @@ Database:
The output directory for the diff report.

Logging:
--log.stdout.format <FORMAT>
The format to use for logs written to stdout

[default: terminal]

Possible values:
- json: Represents JSON formatting for logs. This format outputs log records as JSON objects, making it suitable for structured logging
- log-fmt: Represents logfmt (key=value) formatting for logs. This format is concise and human-readable, typically used in command-line applications
- terminal: Represents terminal-friendly formatting for logs

--log.stdout.filter <FILTER>
The filter to use for logs written to stdout

[default: info]

--log.file.format <FORMAT>
The format to use for logs written to the log file

[default: terminal]

Possible values:
- json: Represents JSON formatting for logs. This format outputs log records as JSON objects, making it suitable for structured logging
- log-fmt: Represents logfmt (key=value) formatting for logs. This format is concise and human-readable, typically used in command-line applications
- terminal: Represents terminal-friendly formatting for logs

--log.file.filter <FILTER>
The filter to use for logs written to the log file

[default: debug]

--log.file.directory <PATH>
The path to put log files in

Expand All @@ -80,11 +110,6 @@ Logging:

[default: 5]

--log.file.filter <FILTER>
The filter to use for logs written to the log file

[default: debug]

--log.journald
Write logs to journald

Expand Down
37 changes: 31 additions & 6 deletions book/cli/reth/db/drop.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Deletes all database entries

```text
```bash
$ reth db drop --help
Usage: reth db drop [OPTIONS]

Expand Down Expand Up @@ -45,6 +45,36 @@ Options:
Print help (see a summary with '-h')

Logging:
--log.stdout.format <FORMAT>
The format to use for logs written to stdout

[default: terminal]

Possible values:
- json: Represents JSON formatting for logs. This format outputs log records as JSON objects, making it suitable for structured logging
- log-fmt: Represents logfmt (key=value) formatting for logs. This format is concise and human-readable, typically used in command-line applications
- terminal: Represents terminal-friendly formatting for logs

--log.stdout.filter <FILTER>
The filter to use for logs written to stdout

[default: info]

--log.file.format <FORMAT>
The format to use for logs written to the log file

[default: terminal]

Possible values:
- json: Represents JSON formatting for logs. This format outputs log records as JSON objects, making it suitable for structured logging
- log-fmt: Represents logfmt (key=value) formatting for logs. This format is concise and human-readable, typically used in command-line applications
- terminal: Represents terminal-friendly formatting for logs

--log.file.filter <FILTER>
The filter to use for logs written to the log file

[default: debug]

--log.file.directory <PATH>
The path to put log files in

Expand All @@ -60,11 +90,6 @@ Logging:

[default: 5]

--log.file.filter <FILTER>
The filter to use for logs written to the log file

[default: debug]

--log.journald
Write logs to journald

Expand Down
Loading
Loading