From 5ed59329be62c0b3a59fb47a89fd8c00a74bed5d Mon Sep 17 00:00:00 2001 From: Mitja Felicijan Date: Thu, 22 Jan 2026 02:35:46 +0100 Subject: Add Levenshtein distance --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index 6401b69..c001382 100644 --- a/README.md +++ b/README.md @@ -35,9 +35,12 @@ make all ## Usage ```bash -./crep [path] +./crep [-c|--case-sensitive] [-l|--levenshtein ] [-d|--depth ] [path] ``` +- `-c, --case-sensitive`: Enable case-sensitive matching (default is case-insensitive). +- `-l, --levenshtein `: Enable fuzzy matching with a maximum Levenshtein distance of ``. +- `-d, --depth `: Set the maximum recursion depth for directory traversal. - ``: The string to search for within function/method names. - `[path]`: Optional. The directory or file to search (defaults to current directory). @@ -48,6 +51,7 @@ make all ### Examples Search for all functions containing "init" in the current directory: + ```bash ./crep init . ``` @@ -62,6 +66,12 @@ Run with debug logging enabled: DEBUG=1 ./crep init . ``` +Search for "main" allowing for 2 typos (e.g. "mian"): + +```bash +./crep -l 2 "mian" main.c +``` + ## How It Works `crep` works by: -- cgit v1.2.3