From bab5d7800ab31adfaa3d051c040194c17db1a52e Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 1 Aug 2013 13:17:30 +0200 Subject: doc c version, except how to use opts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- info/argparser.texinfo | 48 +++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 5 deletions(-) (limited to 'info') diff --git a/info/argparser.texinfo b/info/argparser.texinfo index f0b4e10..c7a0f21 100644 --- a/info/argparser.texinfo +++ b/info/argparser.texinfo @@ -53,8 +53,8 @@ Texts. A copy of the license is included in the section entitled * Overview:: Brief overview of @command{argparser}. * Python version:: Using the Python version. * Java version:: Using the Java version. +* C version:: Using the C version. @c* Bash version:: Using the Bash version. -@c* C version:: Using the C version. * GNU Free Documentation License:: Copying and sharing this manual. @end menu @@ -182,6 +182,8 @@ Further @code{support_alternatives}, @code{test_exclusiveness}, without @var{min} is named @code{testFilesMax} and @code{testFiles} without @var{max} is named @code{testFilesMin}. +@code{parse} takes an array of arguments, which excludes the executable. + @var{message} is a @code{String}, @var{files} is a @code{ArrayList}, @var{unrecognisedCount} is a @code{int}, @var{arguments} is a @code{String[]}, and @var{opts} is a @code{HashMap}. @@ -201,13 +203,49 @@ optioned anywhere, and the alterantive array is variadic if places last. -@c@node Bash version -@c@chapter Bash version +@node C version +@chapter C version + +To use ArgParser, compile with the linker option @code{-largparser} +and use the include @code{#include }. ArgParser uses the +namespace @code{args}. When you are done using ArgParser you should +free its resources using function @code{args_dispose}. + +@code{args_init} corresponds the the @code{ArgParser} constructor in +the Python version, but all parameters are manditory. + +@code{args_arguments}, @code{args_arguments_count}, +@code{args_unrecognised_count}, @code{args_message} and @code{args_files} +works as their Python version counterparts, and @code{args_files_count} +tells how many elements there are in @code{args_files}. +@code{args_parent_name} takes the number of levels as a manditory +parameters, and no other parameter. @code{args_help} and +@code{args_support_alternatives} takes no parameters, and @code{args_parse} +takes @var{argc} and @var{argv}, the arguments in your main method. +@code{args_test_files_min}, @code{args_test_files_max} and +@code{args_test_files} works are their Java version counterparts, except +that an return code may not be specified. +@code{args_test_allowed} and @code{args_test_exclusiveness} both takes +a string array followed by the number of strings in that array, and no +return code. -@c@node C version -@c@chapter C version +To popule ArgParser with valid options, use the method @code{args_add_option} +which takes the options followed by a description as its parameters, the +description can be @code{NULL}. +To create an options use either @code{args_new_argumentless}, +@code{args_new_argumented} or @code{args_new_variadic}. With the exception +that @code{args_new_argumentless} does not have the first parameters, these +methods have three parameters: a descriptive short name of a argument +associated with the option, the index of the primary alternative, and +finally a variadic parameter with the alternatives, meaning that each +alternative is an argument. + + + +@c@node Bash version +@c@chapter Bash version -- cgit v1.2.3-70-g09d2