Skip to content
Snippets Groups Projects
Commit 59ca1275 authored by Eric Vidal's avatar Eric Vidal :speech_balloon:
Browse files

fix options arguments

parent 432c7353
No related branches found
No related tags found
No related merge requests found
......@@ -22,6 +22,7 @@
#include <oblibs/graph.h>
#include <skalibs/stralloc.h>
#include <skalibs/sgetopt.h>
#include <66/constants.h>
#include <66/config.h>
......@@ -145,6 +146,28 @@ int ssexec_init(int argc, char const *const *argv, ssexec_t *info)
stralloc sa = STRALLOC_ZERO ;
{
subgetopt l = SUBGETOPT_ZERO ;
for (;;)
{
int opt = subgetopt_r(argc, argv, OPTS_INIT, &l) ;
if (opt == -1) break ;
switch (opt) {
case 'h' :
info_help(info->help, info->usage) ;
return 0 ;
default :
log_usage(info->usage, "\n", info->help) ;
}
}
argc -= l.ind ; argv += l.ind ;
}
if (!argc)
log_usage(info->usage, "\n", info->help) ;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment