diff --git a/src/lib66/exec/ssexec_init.c b/src/lib66/exec/ssexec_init.c index 28159faadb394e86fcc076e95bed9c749e60ea19..adf22c4c5442f38a7ae44d8bf5d2371470fe9d4b 100644 --- a/src/lib66/exec/ssexec_init.c +++ b/src/lib66/exec/ssexec_init.c @@ -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) ;