Commit 442550b8 authored by Lefebvre, Jordan's avatar Lefebvre, Jordan
Browse files

Minor edits

See merge request !98
parents b46f658b c3452fcc
Pipeline #115738 passed with stages
in 18 minutes and 35 seconds
...@@ -136,6 +136,11 @@ void CommandLine::printParsedLine(std::ostream &out) const ...@@ -136,6 +136,11 @@ void CommandLine::printParsedLine(std::ostream &out) const
void CommandLine::help(std::ostream &out) const void CommandLine::help(std::ostream &out) const
{ {
// dump commandline example first // dump commandline example first
// if there is a description, add it up front
if (!mDescription.empty())
{
out << mDescription << std::endl;
}
out << mExecutable; out << mExecutable;
for (const auto &it : mData) for (const auto &it : mData)
{ {
...@@ -287,6 +292,13 @@ bool CommandLine::validate(std::ostream &out) const ...@@ -287,6 +292,13 @@ bool CommandLine::validate(std::ostream &out) const
return valid; return valid;
} }
const std::string &CommandLine::description() const { return mDescription; }
void CommandLine::setDescription(const std::string &description)
{
mDescription = description;
}
template <> template <>
std::string CommandLine::get(const std::string &name) const std::string CommandLine::get(const std::string &name) const
{ {
......
...@@ -82,9 +82,13 @@ class RADIX_PUBLIC CommandLine ...@@ -82,9 +82,13 @@ class RADIX_PUBLIC CommandLine
*/ */
bool validate(std::ostream &out) const; bool validate(std::ostream &out) const;
const std::string &description() const;
void setDescription(const std::string &description);
private: private:
int mArgc; int mArgc;
char **mArgv; char **mArgv;
std::string mDescription;
std::string mExecutable; std::string mExecutable;
std::vector<std::string> mArgs; std::vector<std::string> mArgs;
std::vector<std::pair<std::string, std::string>> mDeclArgs; std::vector<std::pair<std::string, std::string>> mDeclArgs;
......
TRIBITS_ADD_EXECUTABLE(radixsnd2arl #TRIBITS_ADD_EXECUTABLE(fmsscoreex
NOEXEPREFIX # NOEXEPREFIX
SOURCES radixsnd2arl.cc # SOURCES fmsscoreex.cc
) #)
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment