class Appl: addArgs function added.
This commit is contained in:
+12
-2
@@ -34,6 +34,12 @@ Appl::~Appl()
|
||||
m_params.clear();
|
||||
}
|
||||
|
||||
void Appl::addArgs(const std::string argTxt, const int argNum)
|
||||
{
|
||||
m_argTxt = argTxt;
|
||||
m_argNum = argNum;
|
||||
}
|
||||
|
||||
void Appl::addItem(const char* name, Param param, const char* shortname,
|
||||
const char* longname, const char* description,
|
||||
Datatype datatype, Optiontype optiontype)
|
||||
@@ -56,8 +62,12 @@ void Appl::addItem(const char* name, Param param, const char* shortname,
|
||||
void Appl::printArgs()
|
||||
{
|
||||
std::cerr << std::endl << "Usage:" << std::endl << " "
|
||||
<< m_argv[0].substr(2) << " [Options]" << std::endl
|
||||
<< std::endl << "Options:" << std::endl;
|
||||
<< m_argv[0].substr(2) << " [Options]" ;
|
||||
|
||||
if (m_argTxt.size() != 0)
|
||||
std::cerr << " " << m_argTxt;
|
||||
|
||||
std::cerr << std::endl << std::endl << "Options:" << std::endl;
|
||||
|
||||
for (a_it = m_args.begin(); a_it < m_args.end(); a_it++) {
|
||||
const char* c = (strlen(a_it->shortname) == 1) ? a_it->shortname : " ";
|
||||
|
||||
Reference in New Issue
Block a user