Skip to content

Commit 76fa405

Browse files
committed
Added const to long option parameter in arg_argument structure
Fixed C++ compatibility by adding a `const` keyword to `long_arg` field in `arg_argument` structure
1 parent e36bf67 commit 76fa405

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

argparse.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,13 @@ typedef unsigned char arg_flags;
9696
/* struct arg_argument
9797
* Contains a basic description of the argument list
9898
* char short_arg: a short variant of the argument's key (i.e: -r)
99-
* char * long_arg: a long variant of the argument's key (i.e: --recursive)
99+
* const char * long_arg: a long variant of the argument's key (i.e: --recursive)
100100
* arg_handler handler: a handler for the value to be parsed
101101
* void * retval: the variable, which accepts the parsed value
102102
* arg_flags flags: flags, which define the argument's parsing behavior */
103103
struct arg_argument {
104104
char short_arg;
105-
char * long_arg;
105+
const char * long_arg;
106106
arg_handler handler;
107107
void * retval;
108108
arg_flags flags;

0 commit comments

Comments
 (0)