summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorKai Blin <kai@samba.org>2008-05-15 10:14:41 +0200
committerKai Blin <kai@samba.org>2008-05-20 14:28:12 +0200
commit0210f7af917d0e4ea1f16f9c6e767b8fe817c095 (patch)
tree23720fe77b5f58faa8bcfd33396ba5d8eb18e9e9 /source3/utils
parent89cd35d0549eeee1c31d976b86cf4fd45a664c8a (diff)
downloadsamba-0210f7af917d0e4ea1f16f9c6e767b8fe817c095.tar.gz
samba-0210f7af917d0e4ea1f16f9c6e767b8fe817c095.tar.bz2
samba-0210f7af917d0e4ea1f16f9c6e767b8fe817c095.zip
net: The top level help function for net cmd is always net_cmd_usage
(This used to be commit f7d0903a58b0b0fc248a613937a101f15baa5311)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_ads.c8
-rw-r--r--source3/utils/net_dom.c20
-rw-r--r--source3/utils/net_groupmap.c8
-rw-r--r--source3/utils/net_help.c14
-rw-r--r--source3/utils/net_proto.h21
-rw-r--r--source3/utils/net_rap.c10
-rw-r--r--source3/utils/net_rpc.c11
7 files changed, 37 insertions, 55 deletions
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
index 40bbdad0c6..8053b24051 100644
--- a/source3/utils/net_ads.c
+++ b/source3/utils/net_ads.c
@@ -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
diff --git a/source3/utils/net_dom.c b/source3/utils/net_dom.c
index 1a876a7ba3..a0de818bff 100644
--- a/source3/utils/net_dom.c
+++ b/source3/utils/net_dom.c
@@ -20,22 +20,14 @@
#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}
};
diff --git a/source3/utils/net_groupmap.c b/source3/utils/net_groupmap.c
index 55ba0ba80c..4b4ec45dea 100644
--- a/source3/utils/net_groupmap.c
+++ b/source3/utils/net_groupmap.c
@@ -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);
}
diff --git a/source3/utils/net_help.c b/source3/utils/net_help.c
index 6138a1e511..ddb8d76336 100644
--- a/source3/utils/net_help.c
+++ b/source3/utils/net_help.c
@@ -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);
diff --git a/source3/utils/net_proto.h b/source3/utils/net_proto.h
index 6d6700aa50..7606ba7e08 100644
--- a/source3/utils/net_proto.h
+++ b/source3/utils/net_proto.h
@@ -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 */
diff --git a/source3/utils/net_rap.c b/source3/utils/net_rap.c
index 32d9fbe409..f50b579ac2 100644
--- a/source3/utils/net_rap.c
+++ b/source3/utils/net_rap.c
@@ -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);
}
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index a7ff9bf0a8..3779611d01 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -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);
}
/**