summaryrefslogtreecommitdiffstats
path: root/carg_parser.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-02-21 16:26:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-02-21 16:26:49 +0000
commit44d4d7d11c87a21d329de628b9921a2f02fd7244 (patch)
tree95010f15f34fc0c4f8ae8bbdc3df86fd6fbd5c73 /carg_parser.h
parentReleasing debian version 1.11-3. (diff)
downloadpdlzip-44d4d7d11c87a21d329de628b9921a2f02fd7244.tar.xz
pdlzip-44d4d7d11c87a21d329de628b9921a2f02fd7244.zip
Merging upstream version 1.12.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'carg_parser.h')
-rw-r--r--carg_parser.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/carg_parser.h b/carg_parser.h
index c5f2352..0c64861 100644
--- a/carg_parser.h
+++ b/carg_parser.h
@@ -1,5 +1,5 @@
/* Arg_parser - POSIX/GNU command line argument parser. (C version)
- Copyright (C) 2006-2021 Antonio Diaz Diaz.
+ Copyright (C) 2006-2022 Antonio Diaz Diaz.
This library is free software. Redistribution and use in source and
binary forms, with or without modification, are permitted provided
@@ -24,9 +24,9 @@
message.
'options' is an array of 'struct ap_Option' terminated by an element
- containing a code which is zero. A null name means a short-only
- option. A code value outside the unsigned char range means a
- long-only option.
+ containing a code which is zero. A null long_name means a short-only
+ option. A code value outside the unsigned char range means a long-only
+ option.
Arg_parser normally makes it appear as if all the option arguments
were specified before all the non-option arguments for the purposes
@@ -50,7 +50,7 @@ enum ap_Has_arg { ap_no, ap_yes, ap_maybe };
struct ap_Option
{
int code; /* Short option letter or code ( code != 0 ) */
- const char * name; /* Long option name (maybe null) */
+ const char * long_name; /* Long option name (maybe null) */
enum ap_Has_arg has_arg;
};
@@ -58,6 +58,7 @@ struct ap_Option
struct ap_Record
{
int code;
+ char * parsed_name;
char * argument;
};
@@ -86,6 +87,9 @@ int ap_arguments( const struct Arg_parser * const ap );
Else ap_argument( i ) is the option's argument (or empty). */
int ap_code( const struct Arg_parser * const ap, const int i );
+/* Full name of the option parsed (short or long). */
+const char * ap_parsed_name( const struct Arg_parser * const ap, const int i );
+
const char * ap_argument( const struct Arg_parser * const ap, const int i );
#ifdef __cplusplus