s3:rpclient: rpclient help is not very helpful
authorTim Beale <timbeale@catalyst.net.nz>
Tue, 22 Jan 2019 22:07:42 +0000 (11:07 +1300)
committerRalph Boehme <slow@samba.org>
Fri, 25 Jan 2019 12:20:23 +0000 (13:20 +0100)
The help was not telling me that there was a mandatory 'server' argument
that I needed to specify. After trying several different combinations
of parameters, I eventually had to run the tool in gdb to work out why
it was complaining.

This is the output I was getting:

bin/rpcclient -U$USERNAME%$PASSWORD -I $SERVER_IP
Usage: rpcclient [OPTION...]
  -c, --command=COMMANDS                 Execute semicolon separated
cmds
  -I, --dest-ip=IP                       Specify destination IP address
  -p, --port=PORT                        Specify port number
...

New help output is:

Usage: rpcclient [OPTION...] <server>
Options:
  -c, --command=COMMANDS                 Execute semicolon separated
cmds
...

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/rpcclient/rpcclient.c

index 9f95f1a7a8c948333cc80af10a1fc1ef24ed3e60..6cfacb19cfe49ae3ecb589edb5331c1629a47d72 100644 (file)
@@ -982,6 +982,8 @@ out_free:
        pc = poptGetContext("rpcclient", argc, const_argv,
                            long_options, 0);
 
+       poptSetOtherOptionHelp(pc, "[OPTION...] <server>\nOptions:");
+
        if (argc == 1) {
                poptPrintHelp(pc, stderr, 0);
                goto done;