net: Add net_display_usage_from_functable()
authorKai Blin <kai@samba.org>
Thu, 5 Jun 2008 21:22:19 +0000 (23:22 +0200)
committerKai Blin <kai@samba.org>
Tue, 10 Jun 2008 07:45:55 +0000 (09:45 +0200)
(This used to be commit de0e15b35ea46cfcdd82f45eb3329c44d7aacb90)

source3/utils/net_proto.h
source3/utils/net_util.c

index 31ee584c4c01b83d2fed08beef177f087c4c8452..79ff8fed79510fad150065e734d9722c6d72917e 100644 (file)
@@ -462,6 +462,7 @@ int net_run_function2(struct net_context *c, int argc, const char **argv,
                      const char *whoami, struct functable2 *table);
 int net_run_function3(struct net_context *c, int argc, const char **argv,
                      const char *whoami, struct functable3 *table);
+void net_display_usage_from_functable(struct functable3 *table);
 
 /* The following definitions come from utils/netlookup.c  */
 
index 826a2fb40f2db6348461a7818593da7d37261196..695d285390678132563445f4de71776affe553b4 100644 (file)
@@ -622,3 +622,10 @@ int net_run_function3(struct net_context *c, int argc, const char **argv,
        return c->display_usage?0:-1;
 }
 
+void net_display_usage_from_functable(struct functable3 *table)
+{
+       int i;
+       for (i=0; table[i].funcname != NULL; i++) {
+               d_printf("%s\n", table[i].usage);
+       }
+}