]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/opt-help.c
Opt: Documented opt and its interaction with conf
[libucw.git] / ucw / opt-help.c
index 83b39835b98c4561b38ba15f7e27ad39817dc2a5..4166cc5f717e627e41e993b0a7e7d53dd83f5885 100644 (file)
@@ -95,6 +95,8 @@ static void opt_help_scan(struct help *h, const struct opt_section *sec)
   for (struct opt_item * item = sec->opt; item->cls != OPT_CL_END; item++) {
     if (item->cls == OPT_CL_SECTION)
       opt_help_scan(h, item->u.section);
   for (struct opt_item * item = sec->opt; item->cls != OPT_CL_END; item++) {
     if (item->cls == OPT_CL_SECTION)
       opt_help_scan(h, item->u.section);
+    else if (item->cls == OPT_CL_HOOK)
+      ;
     else {
       struct opt_precomputed opt;
       opt_precompute(&opt, item);
     else {
       struct opt_precomputed opt;
       opt_precompute(&opt, item);
@@ -156,3 +158,9 @@ void opt_help(const struct opt_section * sec) {
   mp_delete(h.pool);
 }
 
   mp_delete(h.pool);
 }
 
+void opt_handle_help(struct opt_item * opt UNUSED, const char * value UNUSED, void * data)
+{
+  struct opt_context *oc = data;
+  opt_help(oc->options);
+  exit(0);
+}