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

fix help call of state command

parent a5e277a4
No related branches found
No related tags found
No related merge requests found
......@@ -245,6 +245,8 @@ extern char const *help_halt ;
#define OPTS_SIGNAL_LEN (sizeof OPTS_SIGNAL - 1)
#define OPTS_ENV "hc:s:VLr:e:i:"
#define OPTS_ENV_LEN (sizeof OPTS_ENV - 1)
#define OPTS_STATE "h"
#define OPTS_STATE_LEN (sizeof OPTS_STATE - 1)
#define OPTS_TREE_WRAPPER "h"
#define OPTS_TREE_WRAPPER_LEN (sizeof OPTS_TREE_WRAPPER - 1)
......
......@@ -19,6 +19,7 @@
#include <skalibs/types.h>
#include <skalibs/lolstdio.h>
#include <skalibs/buffer.h>
#include <skalibs/sgetopt.h>
#include <66/info.h>
#include <66/resolve.h>
......@@ -81,8 +82,27 @@ int ssexec_state(int argc, char const *const *argv, ssexec_t *info)
"issupervised",
"isup" } ;
argc-- ;
argv++ ;
{
subgetopt l = SUBGETOPT_ZERO ;
for (;;)
{
int opt = subgetopt_r(argc, argv, OPTS_ENABLE, &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