From 720f7af2ffdac36bf413e66eae3fc4c82ccd9c0e Mon Sep 17 00:00:00 2001 From: Pavel Ivanov Date: Tue, 30 Apr 2024 19:19:23 +0200 Subject: [PATCH] new: improved value names in command line options --- Cargo.lock | 4 +-- Cargo.toml | 2 +- README.md | 78 +++++++++++++++++++++---------------------- src/cli.rs | 91 ++++++++++++++++++++++++++++++++++++++++----------- src/config.rs | 7 +++- 5 files changed, 119 insertions(+), 63 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 76837f56..ec49b9d8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -600,7 +600,7 @@ checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" [[package]] name = "encstr" -version = "0.28.1-alpha.4" +version = "0.28.1-alpha.5" [[package]] name = "enum-map" @@ -757,7 +757,7 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hl" -version = "0.28.1-alpha.4" +version = "0.28.1-alpha.5" dependencies = [ "atoi", "bincode", diff --git a/Cargo.toml b/Cargo.toml index 0c43fb66..5b4aa0c8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ members = [".", "crate/encstr"] [workspace.package] repository = "https://github.com/pamburus/hl" authors = ["Pavel Ivanov "] -version = "0.28.1-alpha.4" +version = "0.28.1-alpha.5" edition = "2021" license = "MIT" diff --git a/README.md b/README.md index aee48c4e..530c158b 100644 --- a/README.md +++ b/README.md @@ -458,45 +458,45 @@ Arguments: [FILE]... Files to process Options: - -c, --color [] Color output options [env: HL_COLOR=] [default: auto] [possible values: auto, always, never] - --paging Output paging options [env: HL_PAGING=] [default: auto] [possible values: auto, always, never] - -P Handful alias for --paging=never, overrides --paging option - --theme Color theme [env: HL_THEME=] [default: universal] - -r, --raw Output raw source messages instead of formatter messages, it can be useful for applying filters and saving results in original format - --no-raw Disable raw source messages output, overrides --raw option - --raw-fields Disable unescaping and prettifying of field values - --allow-prefix Allow non-JSON prefixes before JSON messages [env: HL_ALLOW_PREFIX=] - --interrupt-ignore-count Number of interrupts to ignore, i.e. Ctrl-C (SIGINT) [env: HL_INTERRUPT_IGNORE_COUNT=] [default: 3] - --buffer-size Buffer size [env: HL_BUFFER_SIZE=] [default: "256 KiB"] - --max-message-size Maximum message size [env: HL_MAX_MESSAGE_SIZE=] [default: "64 MiB"] - -C, --concurrency Number of processing threads [env: HL_CONCURRENCY=] - -f, --filter Filtering by field values in one of forms [k=v, k~=v, k~~=v, 'k!=v', 'k!~=v', 'k!~~=v'] where ~ does substring match and ~~ does regular expression match - -q, --query Custom query, accepts expressions from --filter and supports '(', ')', 'and', 'or', 'not', 'in', 'contain', 'like', '<', '>', '<=', '>=', etc - -h, --hide Hide or reveal fields with the specified keys, prefix with ! to reveal, specify '!*' to reveal all - -l, --level Filtering by level [env: HL_LEVEL=] - --since Filtering by timestamp >= the value (--time-zone and --local options are honored) - --until Filtering by timestamp <= the value (--time-zone and --local options are honored) - -t, --time-format Time format, see https://man7.org/linux/man-pages/man1/date.1.html [env: HL_TIME_FORMAT=] [default: "%b %d %T.%3N"] - -Z, --time-zone Time zone name, see column "TZ identifier" at https://en.wikipedia.org/wiki/List_of_tz_database_time_zones [env: HL_TIME_ZONE=] [default: UTC] - -L, --local Use local time zone, overrides --time-zone option - --no-local Disable local time zone, overrides --local option - --unix-timestamp-unit Unix timestamp unit [env: HL_UNIX_TIMESTAMP_UNIT=] [default: auto] [possible values: auto, s, ms, us, ns] - -e, --hide-empty-fields Hide empty fields, applies for null, string, object and array fields only [env: HL_HIDE_EMPTY_FIELDS=] - -E, --show-empty-fields Show empty fields, overrides --hide-empty-fields option [env: HL_SHOW_EMPTY_FIELDS=] - --input-info Show input number and/or input filename before each message [default: auto] [possible values: auto, none, full, compact, minimal] - --list-themes List available themes and exit - -s, --sort Sort messages chronologically - -F, --follow Follow input streams and sort messages chronologically during time frame set by --sync-interval-ms option - --tail Number of last messages to preload from each file in --follow mode [default: 10] - --sync-interval-ms Synchronization interval for live streaming mode enabled by --follow option [default: 100] - -o, --output Output file - --delimiter Log message delimiter, [NUL, CR, LF, CRLF] or any custom string - --input-format Input format [env: HL_INPUT_FORMAT=] [default: auto] [possible values: auto, json, logfmt] - --dump-index Dump index metadata and exit - --debug Print debug error messages that can help with troubleshooting - --shell-completions Print shell auto-completion script and exit [possible values: bash, elvish, fish, powershell, zsh] - --help Print help - -V, --version Print version + -c, --color [] Color output options [env: HL_COLOR=] [default: auto] [possible values: auto, always, never] + --paging Output paging options [env: HL_PAGING=] [default: auto] [possible values: auto, always, never] + -P Handful alias for --paging=never, overrides --paging option + --theme Color theme [env: HL_THEME=] [default: universal] + -r, --raw Output raw source messages instead of formatter messages, it can be useful for applying filters and saving results in original format + --no-raw Disable raw source messages output, overrides --raw option + --raw-fields Disable unescaping and prettifying of field values + --allow-prefix Allow non-JSON prefixes before JSON messages [env: HL_ALLOW_PREFIX=] + --interrupt-ignore-count Number of interrupts to ignore, i.e. Ctrl-C (SIGINT) [env: HL_INTERRUPT_IGNORE_COUNT=] [default: 3] + --buffer-size Buffer size [env: HL_BUFFER_SIZE=] [default: "256 KiB"] + --max-message-size Maximum message size [env: HL_MAX_MESSAGE_SIZE=] [default: "64 MiB"] + -C, --concurrency Number of processing threads [env: HL_CONCURRENCY=] + -f, --filter Filtering by field values in one of forms [k=v, k~=v, k~~=v, 'k!=v', 'k!~=v', 'k!~~=v'] where ~ does substring match and ~~ does regular expression match + -q, --query Custom query, accepts expressions from --filter and supports '(', ')', 'and', 'or', 'not', 'in', 'contain', 'like', '<', '>', '<=', '>=', etc + -h, --hide Hide or reveal fields with the specified keys, prefix with ! to reveal, specify '!*' to reveal all + -l, --level Filtering by level [env: HL_LEVEL=] + --since