From 7dbbdc150292fa9076ce8e3b2c6a8937214d03e0 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Fri, 30 Nov 2018 18:04:10 +0100 Subject: src: provide suggestion for misspelled object name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use this from the lookup path, to check for misspellings: # nft add table filter # nft add chain filtre test Error: No such file or directory; did you mean table ‘filter’ in family ip? add chain filtre test ^^^^^^ Signed-off-by: Pablo Neira Ayuso --- include/misspell.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 include/misspell.h (limited to 'include/misspell.h') diff --git a/include/misspell.h b/include/misspell.h new file mode 100644 index 00000000..ba01e741 --- /dev/null +++ b/include/misspell.h @@ -0,0 +1,13 @@ +#ifndef _MISSPELL_H_ +#define _MISSPELL_H_ + +struct string_misspell_state { + unsigned int min_distance; + void *obj; +}; + +void string_misspell_init(struct string_misspell_state *st); +int string_misspell_update(const char *a, const char *b, + void *obj, struct string_misspell_state *st); + +#endif -- cgit v1.2.3