Added the usage report to the examples for when no arguments are passed

to the examples.
This commit is contained in:
Robert Osfield
2003-04-06 21:32:44 +00:00
parent 908164d58a
commit 49a28660dc
40 changed files with 166 additions and 72 deletions

View File

@@ -145,12 +145,12 @@ void ApplicationUsage::write(std::ostream& output, const ApplicationUsage::Usage
output << str << std::endl;
}
void ApplicationUsage::write(std::ostream& output,unsigned int widthOfOutput)
void ApplicationUsage::write(std::ostream& output, unsigned int type, unsigned int widthOfOutput)
{
output << "Usage: "<<getCommandLineUsage()<<std::endl;
bool needspace = false;
if (!getCommandLineOptions().empty())
if ((type&COMMAND_LINE_OPTION) && !getCommandLineOptions().empty())
{
if (needspace) output << std::endl;
output << "Options:"<<std::endl;
@@ -158,7 +158,7 @@ void ApplicationUsage::write(std::ostream& output,unsigned int widthOfOutput)
needspace = true;
}
if (!getEnvironmentalVariables().empty())
if ((type&ENVIRONMENTAL_VARIABLE) && !getEnvironmentalVariables().empty())
{
if (needspace) output << std::endl;
output << "Environmental Variables:"<<std::endl;
@@ -166,7 +166,7 @@ void ApplicationUsage::write(std::ostream& output,unsigned int widthOfOutput)
needspace = true;
}
if (!getKeyboardMouseBindings().empty())
if ((type&KEYBOARD_MOUSE_BINDING) && !getKeyboardMouseBindings().empty())
{
if (needspace) output << std::endl;
output << "Keyboard and Mouse Bindings:"<<std::endl;