summaryrefslogtreecommitdiff
path: root/source3/utils/net_rpc_trust.c
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2011-05-30 11:14:47 +0200
committerGünther Deschner <gd@samba.org>2011-05-30 20:05:34 +0200
commite10f27d5759b2d21c82fdb20f5641e1f6feab158 (patch)
tree859b0798f13f8082398ad19f42415d7a8119d426 /source3/utils/net_rpc_trust.c
parent723ba6024c4821a8902dba0248dfab70f56a8203 (diff)
downloadsamba-e10f27d5759b2d21c82fdb20f5641e1f6feab158.tar.gz
samba-e10f27d5759b2d21c82fdb20f5641e1f6feab158.tar.bz2
samba-e10f27d5759b2d21c82fdb20f5641e1f6feab158.zip
Improve documentation for net rpc trust
Add man pages entries and fix usage output. Signed-off-by: Günther Deschner <gd@samba.org> Autobuild-User: Günther Deschner <gd@samba.org> Autobuild-Date: Mon May 30 20:05:34 CEST 2011 on sn-devel-104
Diffstat (limited to 'source3/utils/net_rpc_trust.c')
-rw-r--r--source3/utils/net_rpc_trust.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/source3/utils/net_rpc_trust.c b/source3/utils/net_rpc_trust.c
index 5d2c7264fa..318c06ffe9 100644
--- a/source3/utils/net_rpc_trust.c
+++ b/source3/utils/net_rpc_trust.c
@@ -419,19 +419,22 @@ static int rpc_trust_common(struct net_context *net_ctx, int argc,
struct other_dom_data *other_dom_data;
struct net_context *other_net_ctx = NULL;
struct dom_data dom_data[2];
+ void (*usage)(void);
+
+ switch (op) {
+ case TRUST_CREATE:
+ usage = print_trust_usage;
+ break;
+ case TRUST_DELETE:
+ usage = print_trust_delete_usage;
+ break;
+ default:
+ DEBUG(0, ("Unsupported trust operation.\n"));
+ return -1;
+ }
if (net_ctx->display_usage) {
- switch (op) {
- case TRUST_CREATE:
- print_trust_usage();
- break;
- case TRUST_DELETE:
- print_trust_delete_usage();
- break;
- default:
- DEBUG(0, ("Unsupported trust operation.\n"));
- return -1;
- }
+ usage();
return 0;
}
@@ -444,7 +447,7 @@ static int rpc_trust_common(struct net_context *net_ctx, int argc,
ret = parse_trust_args(mem_ctx, argc, argv, &other_dom_data, &trust_pw);
if (ret != 0) {
if (ret == EINVAL) {
- print_trust_usage();
+ usage();
} else {
DEBUG(0, ("Failed to parse arguments.\n"));
}
@@ -471,7 +474,7 @@ static int rpc_trust_common(struct net_context *net_ctx, int argc,
(dom_data[1].domain_name == NULL ||
dom_data[1].dns_domain_name == NULL))) {
DEBUG(0, ("Missing required argument.\n"));
- print_trust_usage();
+ usage();
goto done;
}
}