Commit 5a037756 authored by thomas.forbriger's avatar thomas.forbriger
Browse files

croposp [NEW]: add new C++ program file template

parent 8cf2f6d0
/*! \file croposp.cc
* \brief Cross power spectral density
*
* ----------------------------------------------------------------------------
*
* \author Thomas Forbriger
* \date 25/12/2018
*
* Cross power spectral density
*
* Copyright (c) 2018 by Thomas Forbriger (BFO Schiltach)
*
* REVISIONS and CHANGES
* - 25/12/2018 V1.0 Thomas Forbriger
*
* ============================================================================
*/
#define CROPOSP_VERSION \
"CROPOSP V1.0 Cross power spectral density"
#include <iostream>
#include <tfxx/commandline.h>
#include <tsioxx/cmdlinefiles.h>
using std::cout;
using std::cerr;
using std::endl;
int main(int iargc, char* argv[])
{
// define usage information
char usage_text[]=
{
CROPOSP_VERSION "\n"
"usage: croposp" "\n"
" or: croposp --help|-h" "\n"
};
// define full help text
char help_text[]=
{
" "
};
// define commandline options
using namespace tfxx::cmdline;
static Declare options[]=
{
// 0: print help
{"help",arg_no,"-"},
// 1: verbose mode
{"v",arg_no,"-"},
{NULL}
};
// define command line keys for input files
static const char tracekey[]="t";
// define commandline argument modifier keys
static const char* cmdlinekeys[]={tracekey, 0};
// no arguments? print usage...
if (iargc<2)
{
cerr << usage_text << endl;
exit(0);
}
// collect options from commandline
Commandline cmdline(iargc, argv, options);
// help requested? print full help text...
if (cmdline.optset(0))
{
cerr << usage_text << endl;
cerr << help_text << endl;
exit(0);
}
// extract commandline arguments
TFXX_assert(cmdline.extra(), "missing input file");
tfxx::cmdline::Tparsed arguments=parse_cmdline(cmdline, cmdlinekeys);
} // main()
/* ----- END OF croposp.cc ----- */
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