qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chug Rolke" <cro...@redhat.com>
Subject Review Request: QPID-3500 C++ qpidd --help should work despite other command line processing errors
Date Wed, 19 Sep 2012 16:43:00 GMT

This is an automatically generated e-mail. To reply, visit:

Review request for qpid and Alan Conway.


The C++ qpidd broker gets wedged in command line processing during errors. When a parse processing
element throws then the exception message printed suggests to use --help. But at that point
--help will never work as the code to print help is bypassed by try/catch program flow. This
is a customer frustration issue as adding --help like the error message suggests still prints
no help message.

This patch promotes the CLI --version,-v and --help,-h switches to a higher level. 
* If --version is present then the version number is printed and the broker exits. The CLI
args are scanned but not checked for validity.
* If --help is present then a flag is set. During later processing when a processing element
throws then the catch block can know to print help before it passes the exception along.

The patch checks for --version and --help in the CLI only. Having those switches set in environment
variables or the config file are a degenerate cases.

The command line is parsed multiple times during broker startup. Failures early on will print
usage messages different from usage messages that happen after modules are loaded.

This patch does not rely on any boost::program_options features that are not already in use.

This addresses bug QPID-3500.


  trunk/qpid/cpp/include/qpid/Options.h 1387614 
  trunk/qpid/cpp/src/posix/QpiddBroker.cpp 1387614 
  trunk/qpid/cpp/src/qpid/Options.cpp 1387614 
  trunk/qpid/cpp/src/qpidd.h 1387614 
  trunk/qpid/cpp/src/qpidd.cpp 1387614 
  trunk/qpid/cpp/src/windows/QpiddBroker.cpp 1387614 

Diff: https://reviews.apache.org/r/7173/diff/


Passes make test. Compiles and passes on Windows.


Chug Rolke

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message