summaryrefslogtreecommitdiff
path: root/source3/utils/net_rpc.c
diff options
context:
space:
mode:
authorJim McDonough <jmcd@samba.org>2002-03-15 20:03:07 +0000
committerJim McDonough <jmcd@samba.org>2002-03-15 20:03:07 +0000
commitbb38f48f6f2b5a5b8803c622e40107bb15876625 (patch)
tree59f3205bfa0faefc16310ace56d663f4feaadbfe /source3/utils/net_rpc.c
parent7d4378cc892550465b75aae563cd6f7ea1608c21 (diff)
downloadsamba-bb38f48f6f2b5a5b8803c622e40107bb15876625.tar.gz
samba-bb38f48f6f2b5a5b8803c622e40107bb15876625.tar.bz2
samba-bb38f48f6f2b5a5b8803c622e40107bb15876625.zip
Some help cleanups. Formatting and consistency issues. Line up text nicely, and make 'net help rap user' the same as 'net rap user help'...stuff like that
(This used to be commit 17775dae28c724b11cc73f2aeac5f07f9656046c)
Diffstat (limited to 'source3/utils/net_rpc.c')
-rw-r--r--source3/utils/net_rpc.c44
1 files changed, 38 insertions, 6 deletions
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index 42cfd4c647..2ea3142dd5 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -915,6 +915,7 @@ static int rpc_trustdom(int argc, const char **argv)
{"del", rpc_trustdom_del},
{"establish", rpc_trustdom_establish},
{"revoke", rpc_trustdom_revoke},
+ {"help", rpc_trustdom_usage},
{NULL, NULL}
};
@@ -932,18 +933,18 @@ static int rpc_trustdom(int argc, const char **argv)
/**
* Basic usage function for 'net rpc'
* @param argc Standard main() style argc
- * @param argc Standard main() style argv. Initial components are already
+ * @param argv Standard main() style argv. Initial components are already
* stripped
**/
int net_rpc_usage(int argc, const char **argv)
{
- d_printf(" net rpc join \tto join a domain \n");
- d_printf(" net rpc user \tto add, delete and list users\n");
+ d_printf(" net rpc join \t\t\tto join a domain \n");
+ d_printf(" net rpc user \t\t\tto add, delete and list users\n");
d_printf(" net rpc changetrustpw \tto change the trust account password\n");
- d_printf(" net rpc trustdom \tto create trusting domain's account or establish trust\n");
+ d_printf(" net rpc trustdom \t\tto create trusting domain's account or establish trust\n");
d_printf(" net rpc abortshutdown \tto to abort the shutdown of a remote server\n");
- d_printf(" net rpc shutdown \tto to shutdown a remote server\n");
+ d_printf(" net rpc shutdown \t\tto to shutdown a remote server\n");
d_printf("\n");
d_printf("'net rpc shutdown' also accepts the following miscellaneous options:\n"); /* misc options */
d_printf("\t-r or --reboot\trequest remote server reboot on shutdown\n");
@@ -953,10 +954,40 @@ int net_rpc_usage(int argc, const char **argv)
return -1;
}
+
+/**
+ * Help function for 'net rpc'. Calls command specific help if requested
+ * or displays usage of net rpc
+ * @param argc Standard main() style argc
+ * @param argv Standard main() style argv. Initial components are already
+ * stripped
+ **/
+
+int rpc_help(int argc, const char **argv)
+{
+ struct functable func[] = {
+ {"join", rpc_join_usage},
+ {"user", rpc_user_usage},
+ //{"changetrustpw", rpc_changetrustpw_usage},
+ {"trustdom", rpc_trustdom_usage},
+ //{"abortshutdown", rpc_shutdown_abort_usage},
+ //{"shutdown", rpc_shutdown_usage},
+ {NULL, NULL}
+ };
+
+ if (argc == 0) {
+ net_rpc_usage(argc, argv);
+ return -1;
+ }
+
+ return (net_run_function(argc, argv, func, rpc_user_usage));
+}
+
+
/**
* 'net rpc' entrypoint.
* @param argc Standard main() style argc
- * @param argc Standard main() style argv. Initial components are already
+ * @param argv Standard main() style argv. Initial components are already
* stripped
**/
@@ -969,6 +1000,7 @@ int net_rpc(int argc, const char **argv)
{"trustdom", rpc_trustdom},
{"abortshutdown", rpc_shutdown_abort},
{"shutdown", rpc_shutdown},
+ {"help", rpc_help},
{NULL, NULL}
};
return net_run_function(argc, argv, func, net_rpc_usage);