From 8efc535a4a5d02fe8e887d916213f1a0f0dda0af Mon Sep 17 00:00:00 2001 From: Kai Blin Date: Thu, 5 Jun 2008 23:22:19 +0200 Subject: net: Add net_display_usage_from_functable() (This used to be commit de0e15b35ea46cfcdd82f45eb3329c44d7aacb90) --- source3/utils/net_proto.h | 1 + source3/utils/net_util.c | 7 +++++++ 2 files changed, 8 insertions(+) (limited to 'source3/utils') diff --git a/source3/utils/net_proto.h b/source3/utils/net_proto.h index 31ee584c4c..79ff8fed79 100644 --- a/source3/utils/net_proto.h +++ b/source3/utils/net_proto.h @@ -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 */ diff --git a/source3/utils/net_util.c b/source3/utils/net_util.c index 826a2fb40f..695d285390 100644 --- a/source3/utils/net_util.c +++ b/source3/utils/net_util.c @@ -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); + } +} -- cgit