From d1ef8c1c0236cefec9a8cad12a816998bd670819 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 27 Aug 2013 22:44:01 +0200 Subject: issue 7, c version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/argparser.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/argparser.h') diff --git a/src/argparser.h b/src/argparser.h index 3c06584..eb073cd 100644 --- a/src/argparser.h +++ b/src/argparser.h @@ -192,6 +192,11 @@ char** args_files; */ long args_files_count; +/** + * Abbreviated option expander, `null` for disabled + */ +char* (*args_abbreviations)(char*, char**, long); + /** @@ -204,8 +209,9 @@ long args_files_count; * @param program The name of the program, `null` for automatic * @param usestderr Whether to use stderr instead of stdout * @param alternative Whether to use single dash/plus long options + * @param abbreviations Abbreviated option expander, `null` for disabled */ -extern void args_init(char* description, char* usage, char* longdescription, char* program, long usestderr, long alternative); +extern void args_init(char* description, char* usage, char* longdescription, char* program, long usestderr, long alternative, char* (*abbreviations)(char*, char**, long)); /** @@ -214,6 +220,17 @@ extern void args_init(char* description, char* usage, char* longdescription, cha extern void args_dispose(void); +/** + * The standard abbrevation expander + * + * @param argument The option that not recognised + * @param options All recognised options + * @param count The number of elements in `options` + * @return The only possible expansion, otherwise `null` + */ +extern char* args_standard_abbreviations(char* argument, char** options, long count); + + /** * Creates, but does not add, a option that takes no arguments * -- cgit v1.2.3-70-g09d2