Browse Source

update simple-opt to v1.4

master
katherine 2 years ago
parent
commit
7758af77e1
Signed by: ageha GPG Key ID: 2A93AF3EA71C905F
  1. 2
      reqs/simple-opt
  2. 11
      src/opt.c

2
reqs/simple-opt

@ -1 +1 @@
Subproject commit 9e8912b6d5672333e254e7f3aacff3bf99816dff
Subproject commit 879d526d7ee7ee7a876f284dac76075e7a7267ae

11
src/opt.c

@ -1,5 +1,7 @@
#include "opt.h"
#include "simple-opt/simple-opt.h"
#include "../reqs/simple-opt/simple-opt.h"
#include "version.h"
#include <stdbool.h>
#include <stdlib.h>
@ -25,7 +27,6 @@ const static char data_str_default[] = "data";
void opt_parse(int argc, char **argv)
{
struct simple_opt_result result;
const char version[] = "gafu 1.00";
result = simple_opt_parse(argc, argv, options);
@ -46,7 +47,7 @@ void opt_parse(int argc, char **argv)
/* version */
if (options[1].was_seen) {
puts(version);
puts(VERSION);
exit(EXIT_SUCCESS);
}
}
@ -54,13 +55,13 @@ void opt_parse(int argc, char **argv)
const char* opt_config_str(void)
{
return (options[2].was_seen
? options[2].val_string
? options[2].val.v_string
: config_str_default);
}
const char* opt_data_str(void)
{
return (options[3].was_seen
? options[3].val_string
? options[3].val.v_string
: data_str_default);
}
Loading…
Cancel
Save