diff options
Diffstat (limited to 'src/argparser.h')
-rw-r--r-- | src/argparser.h | 19 |
1 files changed, 18 insertions, 1 deletions
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)); /** @@ -215,6 +221,17 @@ 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 * * @param trigger Function to invoked when the option is used, with the used option and the standard option |