Problem

How do I document command-line parameters for (C++) executable files?

Solution

The best way to accomplish this is through Doxygen. To do this for a main(...) function in a *.cpp file, simply add a doxygen comment where you specify the "file" tag. For example:


/** @file maciManager.cpp
 *  Brief description about maciManager goes here.  The detailed description
 *  is anything after the first "." or newline character encountered.  Now we will specify the command-line
 *  parameters by enclosing the actual parameter in double-quotes followed by a brief explanation.
 *  @param "-ORBEndpoint iiop://$HOST:3051" Use this optional parameter to specify which host/port maciManager
 *  should run on.
 */

would produce a "Detailed" section in the Doxygen-generated html page for maciManager.cpp describing the parameters that need to be passed to maciManager.


-- DavidFugate - 28 Jun 2005