From 0fb229b7d8e825324cf224e68199aff544d579a7 Mon Sep 17 00:00:00 2001 From: iff Date: Wed, 9 Apr 2025 17:36:35 +0200 Subject: [PATCH] docs: changes --- CHANGELOG.md | 13 +++++++++++++ rules.md | 8 ++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ffcf053..24c3cd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- Regex support for conditions matching + - `,` cannot be used though + +### Changed + +- Using Damerau variation for string comparison + +### Removed + +- `exe_contains` rule as it can be done with regex + ## [0.7.2] - 2025-04-08 ### Added diff --git a/rules.md b/rules.md index 32df274..1bf30c0 100644 --- a/rules.md +++ b/rules.md @@ -25,8 +25,9 @@ command = "helloworld" # you can add as many `[[match_err]]` section as you want [[match_err]] # Note: -# - patterns must be in lowercase +# - patterns must be in lowercase without extra space characters # - patterns should be the output with `LC_ALL=C` environment variable +# - this is a first-pass match. It should be quick so regex is not supported pattern = [ "pattern 1", "pattern 2" @@ -77,9 +78,8 @@ The placeholder is evaluated as following: Suggestions can have additional conditions to check. To specify conditions, add a `#[...]` at the first line (just like derive macros in Rust). Available conditions: - `executable`: Check if the argument can be found in path -- `cmd_contains`: Check if the last user input contains the argument -- `err_contains`: Check if the error of the command contains the argument -- `exe_contains`: Check if the command name itself contains the argument +- `cmd_contains`: Check if the last user input contains the argument. Regex supported (you can't use `,` currently because it's used as condition separator) +- `err_contains`: Same as `cmd_contains` but for error message - `length`: Check if the given command has the length of the argument - `min_length`: Check if the given command has at least the length of the argument - `max_length`: Check if the given command has at most the length of the argument