Commit e4020e5e authored by thomas.forbriger's avatar thomas.forbriger

ThiesDL1 [WP]: add online documentation to tester program

parent 5032d9bb
......@@ -4,11 +4,12 @@
* ----------------------------------------------------------------------------
*
* \author Thomas Forbriger
* \date 24/03/2014
* \since 24/03/2014
* \date 19/06/2019
*
* a small program to test some functions
*
* Copyright (c) 2008, 2014 by Thomas Forbriger (BFO Schiltach)
* Copyright (c) 2008, 2014, 2019 by Thomas Forbriger (BFO Schiltach)
*
* ----
* This program is free software; you can redistribute it and/or modify
......@@ -28,11 +29,12 @@
*
* REVISIONS and CHANGES
* - 28/11/2008 V1.0 Thomas Forbriger
* - 19/06/2019 V1.1 add syslog test function
*
* ============================================================================
*/
#define TESTER_VERSION \
"TESTER V2014-03-24 a small program to test some functions"
"TESTER V2019-06-19 a small program to test some functions"
#include <iostream>
#include <list>
......@@ -69,7 +71,8 @@ int main(int iargc, char* argv[])
char usage_text[]=
{
TESTER_VERSION "\n"
"usage: tester" "\n"
"usage: tester [-v] [-pattern p] [-Id] [-checkdatepattern p]" "\n"
" [-checkfileexists f] [-preppath p] [-active]\n"
" or: tester --help|-h" "\n"
};
......@@ -77,6 +80,19 @@ int main(int iargc, char* argv[])
char help_text[]=
{
TESTER_VERSION
"flags:\n"
"-v be verbose\n"
"-active set active flag for dl1::mkpathname in test \"-preppath\"\n"
"\n"
"tests:\n"
"-pattern p test pattern replacement function\n"
" dl1::patsubstdate\n"
"-Id dump list of CVSIDS\n"
"-checkdatepattern p test function\n"
" dl1::datetemplatespresent\n"
"-checkfileexists f test functions in tfxx::file\n"
"-preppath p test function\n"
" dl1::mkpathname\n"
};
// define commandline options
......@@ -121,60 +137,6 @@ int main(int iargc, char* argv[])
exit(0);
}
/*
// dummy operation: print option settings
for (int iopt=0; iopt<2; iopt++)
{
cout << "option: '" << options[iopt].opt_string << "'" << endl;
if (cmdline.optset(iopt)) { cout << " option was set"; }
else { cout << "option was not set"; }
cout << endl;
cout << " argument (string): '" << cmdline.string_arg(iopt) << "'" << endl;
cout << " argument (int): '" << cmdline.int_arg(iopt) << "'" << endl;
cout << " argument (long): '" << cmdline.long_arg(iopt) << "'" << endl;
cout << " argument (float): '" << cmdline.float_arg(iopt) << "'" << endl;
cout << " argument (double): '" << cmdline.double_arg(iopt) << "'" << endl;
cout << " argument (bool): '";
if (cmdline.bool_arg(iopt))
{ cout << "true"; } else { cout << "false"; }
cout << "'" << endl;
}
while (cmdline.extra()) { cout << cmdline.next() << endl; }
// dummy operation: print rest of command line
while (cmdline.extra()) { cout << cmdline.next() << endl; }
*/
/*
std::ostringstream oss;
oss << "This is my first item";
oss << dl1::DL1::EOL;
oss << "This is my second item" << dl1::DL1::EOL;
oss << "and here are some numbers: " << 3 << 6.5 << 1 << dl1::DL1::EOL;
std::string eol(dl1::DL1::EOL);
std::string msg(oss.str());
Tlistofstring v=tfxx::string::split<std::list>(msg, eol, true);
for (Tvecofstring::iterator i=v.begin(); i!=v.end(); ++i)
{
cout << *i << endl;
}
*/
// cout << dl1::dl1samplinginterval.timestring() << endl;
/*
if (cmdline.extra())
{
std::string filename=cmdline.next();
cout << "file " << filename << endl;
dl1::Memory mem(filename);
mem.setdefault("key","Wert");
mem.setdefault("schluessel","Wert und wert und wert");
mem.setdefault("datum","2008/12/05");
}
*/
/*======================================================================*/
if (cmdline.optset(3))
......
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