summaryrefslogtreecommitdiff
path: root/tools/common.c
diff options
context:
space:
mode:
authorDavid Wragg <dpw@lshift.net>2010-02-23 08:23:09 +0000
committerDavid Wragg <dpw@lshift.net>2010-02-23 08:23:09 +0000
commitd30240f368ceafa3b201ce4feee8e37b4da84da7 (patch)
tree59be02a96252e36298c2ae625e2d606a5f3862df /tools/common.c
parent773edb56c3bd483056a91a820e50c6ba1137e368 (diff)
downloadrabbitmq-c-d30240f368ceafa3b201ce4feee8e37b4da84da7.tar.gz
amqp-consume should display usage info when the command is omitted.
Diffstat (limited to 'tools/common.c')
-rw-r--r--tools/common.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/tools/common.c b/tools/common.c
index 642da38..0772738 100644
--- a/tools/common.c
+++ b/tools/common.c
@@ -374,9 +374,7 @@ poptContext process_options(int argc, const char **argv,
{
int c;
poptContext opts = poptGetContext(NULL, argc, argv, options, 0);
-
- if (!help)
- poptSetOtherOptionHelp(opts, "[OPTIONS]... <command> <args>");
+ poptSetOtherOptionHelp(opts, help);
while ((c = poptGetNextOpt(opts)) >= 0) {
// no options require explicit handling
@@ -396,7 +394,8 @@ poptContext process_options(int argc, const char **argv,
void process_all_options(int argc, const char **argv,
struct poptOption *options)
{
- poptContext opts = process_options(argc, argv, options, NULL);
+ poptContext opts = process_options(argc, argv, options,
+ "[OPTIONS]...");
const char *opt = poptPeekArg(opts);
if (opt) {