net: The top level help function for net cmd is always net_cmd_usage
authorKai Blin <kai@samba.org>
Thu, 15 May 2008 08:14:41 +0000 (10:14 +0200)
committerKai Blin <kai@samba.org>
Tue, 20 May 2008 12:28:12 +0000 (14:28 +0200)
(This used to be commit f7d0903a58b0b0fc248a613937a101f15baa5311)

source3/utils/net_ads.c
source3/utils/net_dom.c
source3/utils/net_groupmap.c
source3/utils/net_help.c
source3/utils/net_proto.h
source3/utils/net_rap.c
source3/utils/net_rpc.c

index 40bbdad0c637e2881930ef2b072147e486d17715..8053b24051bf9c3238696c8ae0ddcc1d3254e260 100644 (file)
@@ -27,7 +27,7 @@
 
 #ifdef HAVE_ADS
 
-int net_ads_usage(struct net_context *c, int argc, const char **argv)
+int net_ads_help(struct net_context *c, int argc, const char **argv)
 {
        d_printf("join [createupn[=principal]] [createcomputer=<org_unit>]\n");
        d_printf("    Join the local machine to a ADS realm\n");
@@ -2163,7 +2163,7 @@ int net_ads_kerberos(struct net_context *c, int argc, const char **argv)
 }
 
 
-int net_ads_help(struct net_context *c, int argc, const char **argv)
+int net_ads_usage(struct net_context *c, int argc, const char **argv)
 {
        struct functable func[] = {
                {"USER", net_ads_user_usage},
@@ -2180,7 +2180,7 @@ int net_ads_help(struct net_context *c, int argc, const char **argv)
                {NULL, NULL}
        };
 
-       return net_run_function(c, argc, argv, func, net_ads_usage);
+       return net_run_function(c, argc, argv, func, net_ads_help);
 }
 
 int net_ads(struct net_context *c, int argc, const char **argv)
@@ -2209,7 +2209,7 @@ int net_ads(struct net_context *c, int argc, const char **argv)
                {NULL, NULL}
        };
 
-       return net_run_function(c, argc, argv, func, net_ads_usage);
+       return net_run_function(c, argc, argv, func, net_ads_help);
 }
 
 #else
index 1a876a7ba33a4f00cdc26e4ee586f42cf0eb50d6..a0de818bff2444d3bd24cd400d4da1a56230c92e 100644 (file)
 #include "includes.h"
 #include "utils/net.h"
 
-static int net_dom_usage(struct net_context *c, int argc, const char **argv)
+int net_dom_usage(struct net_context *c, int argc, const char **argv)
 {
        d_printf("usage: net dom join "
-                "<domain=DOMAIN> <ou=OU> <account=ACCOUNT> <password=PASSWORD> <reboot>\n");
+                "<domain=DOMAIN> <ou=OU> <account=ACCOUNT> "\
+                "<password=PASSWORD> <reboot>\n  Join a remote machine\n");
        d_printf("usage: net dom unjoin "
-                "<account=ACCOUNT> <password=PASSWORD> <reboot>\n");
-
-       return -1;
-}
-
-int net_help_dom(struct net_context *c, int argc, const char **argv)
-{
-       d_printf("net dom join"\
-               "\n  Join a remote machine\n");
-       d_printf("net dom unjoin"\
-               "\n  Unjoin a remote machine\n");
+                "<account=ACCOUNT> <password=PASSWORD> <reboot>\n"\
+                "  Unjoin a remote machine\n");
 
        return -1;
 }
@@ -238,7 +230,7 @@ int net_dom(struct net_context *c, int argc, const char **argv)
        struct functable func[] = {
                {"JOIN", net_dom_join},
                {"UNJOIN", net_dom_unjoin},
-               {"HELP", net_help_dom},
+               {"HELP", net_dom_usage},
                {NULL, NULL}
        };
 
index 55ba0ba80c476412a780e063aa80e0c8c44ffcca..4b4ec45deaf4d272fe2d1619173a521bac2163e2 100644 (file)
@@ -758,7 +758,7 @@ static int net_groupmap_memberships(struct net_context *c, int argc, const char
        return 0;
 }
 
-int net_help_groupmap(struct net_context *c, int argc, const char **argv)
+int net_groupmap_usage(struct net_context *c, int argc, const char **argv)
 {
        d_printf("net groupmap add"\
                "\n  Create a new group mapping\n");
@@ -801,7 +801,7 @@ int net_groupmap(struct net_context *c, int argc, const char **argv)
                {"listmem", net_groupmap_listmem},
                {"memberships", net_groupmap_memberships},
                {"list", net_groupmap_list},
-               {"help", net_help_groupmap},
+               {"help", net_groupmap_usage},
                {NULL, NULL}
        };
 
@@ -812,8 +812,8 @@ int net_groupmap(struct net_context *c, int argc, const char **argv)
        }
 
        if ( argc )
-               return net_run_function(c, argc, argv, func, net_help_groupmap);
+               return net_run_function(c,argc, argv, func, net_groupmap_usage);
 
-       return net_help_groupmap(c, argc, argv );
+       return net_groupmap_usage(c, argc, argv);
 }
 
index 6138a1e511b96b876905e820ac172cf7658aea4b..ddb8d76336567542277aefc9b1c92d8f00a25317 100644 (file)
@@ -20,7 +20,7 @@
 #include "includes.h"
 #include "utils/net.h"
 
-static int help_usage(struct net_context *c, int argc, const char **argv)
+static int net_help_usage(struct net_context *c, int argc, const char **argv)
 {
        d_printf(
 "\n"\
@@ -69,9 +69,9 @@ static int net_usage(struct net_context *c, int argc, const char **argv)
 int net_help(struct net_context *c, int argc, const char **argv)
 {
        struct functable func[] = {
-               {"ADS", net_ads_help},
-               {"RAP", net_rap_help},
-               {"RPC", net_rpc_help},
+               {"ADS", net_ads_usage},
+               {"RAP", net_rap_usage},
+               {"RPC", net_rpc_usage},
 
                {"FILE", net_file_usage},
                {"SHARE", net_share_usage},
@@ -81,9 +81,9 @@ int net_help(struct net_context *c, int argc, const char **argv)
                {"PRINTQ", net_rap_printq_usage},
                {"USER", net_user_usage},
                {"GROUP", net_group_usage},
-               {"GROUPMAP", net_help_groupmap},
+               {"GROUPMAP", net_groupmap_usage},
                {"JOIN", net_join_usage},
-               {"DOM", net_help_dom},
+               {"DOM", net_dom_usage},
                {"VALIDATE", net_rap_validate_usage},
                {"GROUPMEMBER", net_rap_groupmember_usage},
                {"ADMIN", net_rap_admin_usage},
@@ -97,7 +97,7 @@ int net_help(struct net_context *c, int argc, const char **argv)
                {"AFS", net_afs_usage},
 #endif
 
-               {"HELP", help_usage},
+               {"HELP", net_help_usage},
                {NULL, NULL}};
 
        return net_run_function(c, argc, argv, func, net_usage);
index 6d6700aa50ff0d77edc5024e4fb4ada929961e81..7606ba7e082c6ee6a79175d6095bb873fdd4b1b2 100644 (file)
@@ -52,7 +52,7 @@ int net_run_function2(struct net_context *c, int argc, const char **argv,
 
 /* The following definitions come from utils/net_ads.c  */
 
-int net_ads_usage(struct net_context *c, int argc, const char **argv);
+int net_ads_help(struct net_context *c, int argc, const char **argv);
 ADS_STATUS ads_startup(struct net_context *c, bool only_own_domain, ADS_STRUCT **ads);
 ADS_STATUS ads_startup_nobind(struct net_context *c, bool only_own_domain, ADS_STRUCT **ads);
 int net_ads_check_our_domain(struct net_context *c);
@@ -65,18 +65,7 @@ int net_ads_printer_usage(struct net_context *c, int argc, const char **argv);
 int net_ads_changetrustpw(struct net_context *c, int argc, const char **argv);
 int net_ads_keytab(struct net_context *c, int argc, const char **argv);
 int net_ads_kerberos(struct net_context *c, int argc, const char **argv);
-int net_ads_help(struct net_context *c, int argc, const char **argv);
-int net_ads(struct net_context *c, int argc, const char **argv);
-int net_ads_keytab(struct net_context *c, int argc, const char **argv);
-int net_ads_kerberos(struct net_context *c, int argc, const char **argv);
 int net_ads_usage(struct net_context *c, int argc, const char **argv);
-int net_ads_help(struct net_context *c, int argc, const char **argv);
-int net_ads_changetrustpw(struct net_context *c, int argc, const char **argv);
-int net_ads_join(struct net_context *c, int argc, const char **argv);
-int net_ads_user(struct net_context *c, int argc, const char **argv);
-int net_ads_group(struct net_context *c, int argc, const char **argv);
-int net_ads_check(struct net_context *c);
-int net_ads_check_our_domain(struct net_context *c);
 int net_ads(struct net_context *c, int argc, const char **argv);
 
 /* The following definitions come from utils/net_ads_gpo.c  */
@@ -97,7 +86,7 @@ int get_my_ip_address( struct sockaddr_storage **pp_ss );
 
 /* The following definitions come from utils/net_dom.c  */
 
-int net_help_dom(struct net_context *c, int argc, const char **argv);
+int net_dom_usage(struct net_context *c, int argc, const char **argv);
 int net_dom(struct net_context *c, int argc, const char **argv);
 
 /* The following definitions come from utils/net_file.c  */
@@ -112,7 +101,7 @@ int net_group(struct net_context *c, int argc, const char **argv);
 
 /* The following definitions come from utils/net_groupmap.c  */
 
-int net_help_groupmap(struct net_context *c, int argc, const char **argv);
+int net_groupmap_usage(struct net_context *c, int argc, const char **argv);
 int net_groupmap(struct net_context *c, int argc, const char **argv);
 
 /* The following definitions come from utils/net_help.c  */
@@ -164,8 +153,8 @@ int net_rap_password_usage(struct net_context *c, int argc, const char **argv);
 int net_rap_password(struct net_context *c, int argc, const char **argv);
 int net_rap_admin_usage(struct net_context *c, int argc, const char **argv);
 int net_rap_admin(struct net_context *c, int argc, const char **argv);
-int net_rap_usage(struct net_context *c, int argc, const char **argv);
 int net_rap_help(struct net_context *c, int argc, const char **argv);
+int net_rap_usage(struct net_context *c, int argc, const char **argv);
 int net_rap(struct net_context *c, int argc, const char **argv);
 
 /* The following definitions come from utils/net_registry.c  */
@@ -233,8 +222,8 @@ bool net_rpc_check(struct net_context *c, unsigned flags);
 int rpc_printer_migrate(struct net_context *c, int argc, const char **argv);
 int rpc_printer_usage(struct net_context *c, int argc, const char **argv);
 int net_rpc_printer(struct net_context *c, int argc, const char **argv);
-int net_rpc_usage(struct net_context *c, int argc, const char **argv);
 int net_rpc_help(struct net_context *c, int argc, const char **argv);
+int net_rpc_usage(struct net_context *c, int argc, const char **argv);
 int net_rpc(struct net_context *c, int argc, const char **argv);
 
 /* The following definitions come from utils/net_rpc_audit.c  */
index 32d9fbe4096cc74ac6bf2245efe1983b19f697ab..f50b579ac280ffc6bbd792424a3b6de610ecc616 100644 (file)
@@ -1039,7 +1039,7 @@ int net_rap_admin(struct net_context *c, int argc, const char **argv)
 
 /* The help subsystem for the RAP subcommand */
 
-int net_rap_usage(struct net_context *c, int argc, const char **argv)
+int net_rap_help(struct net_context *c, int argc, const char **argv)
 {
        d_printf("  net rap domain \tto list domains \n"\
                 "  net rap file \t\tto list open files on a server \n"\
@@ -1062,7 +1062,7 @@ int net_rap_usage(struct net_context *c, int argc, const char **argv)
 /*
   handle "net rap help *" subcommands
 */
-int net_rap_help(struct net_context *c, int argc, const char **argv)
+int net_rap_usage(struct net_context *c, int argc, const char **argv)
 {
        struct functable func[] = {
                {"FILE", net_rap_file_usage},
@@ -1080,7 +1080,7 @@ int net_rap_help(struct net_context *c, int argc, const char **argv)
                {"PASSWORD", net_rap_password_usage},
                {NULL, NULL}};
 
-       return net_run_function(c, argc, argv, func, net_rap_usage);
+       return net_run_function(c, argc, argv, func, net_rap_help);
 }
 
 /* Entry-point for all the RAP functions. */
@@ -1101,10 +1101,10 @@ int net_rap(struct net_context *c, int argc, const char **argv)
                {"ADMIN", net_rap_admin},
                {"SERVICE", net_rap_service},
                {"PASSWORD", net_rap_password},
-               {"HELP", net_rap_help},
+               {"HELP", net_rap_usage},
                {NULL, NULL}
        };
 
-       return net_run_function(c, argc, argv, func, net_rap_usage);
+       return net_run_function(c, argc, argv, func, net_rap_help);
 }
 
index a7ff9bf0a8b731049d7c2f6c8d2336f94dafd69b..3779611d012ab8706f5d62c79b23f49379cc3a33 100644 (file)
@@ -6984,7 +6984,7 @@ int net_rpc_printer(struct net_context *c, int argc, const char **argv)
 
 
 /**
- * Basic usage function for 'net rpc'
+ * Basic help function for 'net rpc'
  *
  * @param c    A net_context structure
  * @param argc  Standard main() style argc
@@ -6992,7 +6992,7 @@ int net_rpc_printer(struct net_context *c, int argc, const char **argv)
  *              stripped
  **/
 
-int net_rpc_usage(struct net_context *c, int argc, const char **argv)
+int net_rpc_help(struct net_context *c, int argc, const char **argv)
 {
        d_printf("  net rpc info \t\t\tshow basic info about a domain \n");
        d_printf("  net rpc join \t\t\tto join a domain \n");
@@ -7036,7 +7036,7 @@ int net_rpc_usage(struct net_context *c, int argc, const char **argv)
  *              stripped
  **/
 
-int net_rpc_help(struct net_context *c, int argc, const char **argv)
+int net_rpc_usage(struct net_context *c, int argc, const char **argv)
 {
        struct functable func[] = {
                {"join", rpc_join_usage},
@@ -7048,15 +7048,16 @@ int net_rpc_help(struct net_context *c, int argc, const char **argv)
                /*{"abortshutdown", rpc_shutdown_abort_usage},*/
                /*{"shutdown", rpc_shutdown_usage}, */
                {"vampire", rpc_vampire_usage},
+               {"help", net_rpc_help},
                {NULL, NULL}
        };
 
        if (argc == 0) {
-               net_rpc_usage(c, argc, argv);
+               net_rpc_help(c, argc, argv);
                return -1;
        }
 
-       return net_run_function(c, argc, argv, func, rpc_user_usage);
+       return net_run_function(c, argc, argv, func, net_rpc_help);
 }
 
 /**