aboutsummaryrefslogtreecommitdiffstats
path: root/src/argparser.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2013-08-27 22:44:01 +0200
committerMattias Andrée <maandree@operamail.com>2013-08-27 22:44:01 +0200
commitd1ef8c1c0236cefec9a8cad12a816998bd670819 (patch)
tree17fb298d26680f02f4c3a4b96df097302beafac7 /src/argparser.h
parentissue 7, bash version (diff)
downloadargparser-d1ef8c1c0236cefec9a8cad12a816998bd670819.tar.gz
argparser-d1ef8c1c0236cefec9a8cad12a816998bd670819.tar.bz2
argparser-d1ef8c1c0236cefec9a8cad12a816998bd670819.tar.xz
issue 7, c version
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/argparser.h19
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