39 #ifndef __OPENFLUID_UTILS_STRUCTUREDCOMMANDLINEPARSER_HPP__
40 #define __OPENFLUID_UTILS_STRUCTUREDCOMMANDLINEPARSER_HPP__
60 std::vector<CommandLineCommand> m_Commands;
112 m_Commands.push_back(Command);
125 std::vector<CommandLineSection*> m_CommandSections;
127 std::vector<CommandLineCommand> m_NoSectionCommands;
139 const std::vector<CommandLineSection*>& CommandSections) :
156 m_CommandSections.push_back(CommandSection);
170 for (
const auto& CommandSection : CommandSections)
190 CommandSection->addCommand(Command);
194 m_NoSectionCommands.push_back(Command);
220 size_t CmdSectionIndex = 0;
221 for (
const auto& CmdSection : m_CommandSections)
223 OutStm << CmdSection->getName() <<
": \n";
224 for (
auto& Cmd : CmdSection->getCommands())
228 if(CmdSectionIndex < m_CommandSections.size() - 1)
235 if(m_NoSectionCommands.size() > 0)
237 OutStm <<
"\nOthers: \n";
238 for (
const auto& Cmd : m_NoSectionCommands)
Definition: CommandLineParser.hpp:302
Class for management of command line arguments.
Definition: CommandLineParser.hpp:651
const std::string m_AvailableCommandsText
Definition: CommandLineParser.hpp:664
int getLargestCommandLength()
Definition: CommandLineParser.hpp:671
void displayUsageMessage(std::ostream &OutStm)
Definition: CommandLineParser.hpp:792
void displayFormattedData(std::ostream &OutStm, std::string Title, std::string HelpText, int LargestTextLength)
Definition: CommandLineParser.hpp:732
std::map< std::string, CommandLineCommand > m_Commands
Definition: CommandLineParser.hpp:658
CommandLineOption getHelpOption()
Definition: CommandLineParser.hpp:722
void addCommand(const CommandLineCommand &Command)
Definition: CommandLineParser.hpp:951
int getLargestOptionLength()
Definition: CommandLineParser.hpp:687
void displayOptions(std::ostream &OutStm, CommandLineOption HelpOption, int LargestTextLength)
Definition: CommandLineParser.hpp:742
std::string m_ActiveCommand
Definition: CommandLineParser.hpp:662
Definition: StructuredCommandLineParser.hpp:55
std::vector< CommandLineCommand > getCommands() const
Definition: StructuredCommandLineParser.hpp:96
CommandLineSection(const std::string &Name)
Definition: StructuredCommandLineParser.hpp:69
std::string getName() const
Definition: StructuredCommandLineParser.hpp:82
void addCommand(const CommandLineCommand &Command)
Definition: StructuredCommandLineParser.hpp:110
Definition: StructuredCommandLineParser.hpp:122
StructuredCommandLineParser(const std::string &ProgramName, const std::string &HelpText, const std::vector< CommandLineSection * > &CommandSections)
Definition: StructuredCommandLineParser.hpp:138
void printHelp(std::ostream &OutStm)
Definition: StructuredCommandLineParser.hpp:209
void addCommand(const CommandLineCommand &Command, CommandLineSection *CommandSection=nullptr)
Definition: StructuredCommandLineParser.hpp:186
void addCommandSection(CommandLineSection *CommandSection)
Definition: StructuredCommandLineParser.hpp:154
void addCommandSections(const std::vector< CommandLineSection * > &CommandSections)
Definition: StructuredCommandLineParser.hpp:168
Definition: ApplicationException.hpp:47