STFINV library: seek source wavelet correction filter
onlinehelp.cc
Go to the documentation of this file.
1 
36 #define ONLINEHELP_VERSION \
37  "ONLINEHELP V1.1 print online help"
38 
39 #include <iostream>
40 #include <tfxx/commandline.h>
41 #include <stfinv/stfinvany.h>
42 
43 using std::cout;
44 using std::cerr;
45 using std::endl;
46 
48 std::string procedure_id;
49 
50 int main(int iargc, char* argv[])
51 {
52 
53  // define usage information
54  char usage_text[]=
55  {
57  "usage: onlinehelp [-procedure p] [usage]" "\n"
58  " or: onlinehelp --help|-h" "\n"
59  };
60 
61  // define full help text
62  char help_text[]=
63  {
64  "usage any non-empty parameter lets the program output\n"
65  " the usage summary of libstfinv\n"
66  "-procedure p prints the detailed description of procedure \"p\"\n"
67  };
68 
69  // define commandline options
70  using namespace tfxx::cmdline;
71  static Declare options[]=
72  {
73  // 0: print help
74  {"help",arg_no,"-"},
75  // 1: verbose mode
76  {"v",arg_no,"-"},
77  // 2: verbose mode
78  {"procedure",arg_yes,"-"},
79  {NULL}
80  };
81 
82  // no arguments? print usage...
83  if (iargc<2)
84  {
85  cerr << usage_text << endl;
86  stfinv::engines(cout);
87  exit(0);
88  }
89 
90  // collect options from commandline
91  Commandline cmdline(iargc, argv, options);
92 
93  // help requested? print full help text...
94  if (cmdline.optset(0))
95  {
96  cerr << usage_text << endl << endl;
97  cerr << help_text << endl;
98  stfinv::engines(cout);
99  exit(0);
100  }
101 
102  selectprocedure=cmdline.optset(2);
103  procedure_id=cmdline.string_arg(2);
104 
105  if (selectprocedure)
106  {
108  }
109  else
110  {
111  stfinv::help(cout);
112  }
113 }
114 
115 /* ----- END OF onlinehelp.cc ----- */
std::string procedure_id
Definition: onlinehelp.cc:48
int main(int iargc, char *argv[])
Definition: onlinehelp.cc:50
void engines(std::ostream &os)
Definition: stfinvany.cc:187
#define ONLINEHELP_VERSION
Definition: onlinehelp.cc:36
bool selectprocedure
Definition: onlinehelp.cc:47
void help(std::ostream &os)
Definition: stfinvany.cc:192
a wrapper to any STF engine in the library (prototypes)
void usage(const std::string &id, std::ostream &os)
Definition: stfinvany.cc:197