STFINV library: seek source wavelet correction filter

◆ main()

int main ( int  iargc,
char *  argv[] 
)

Definition at line 50 of file onlinehelp.cc.

References stfinv::engines(), stfinv::help(), ONLINEHELP_VERSION, procedure_id, selectprocedure, and stfinv::usage().

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 }
std::string procedure_id
Definition: onlinehelp.cc:48
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
void usage(const std::string &id, std::ostream &os)
Definition: stfinvany.cc:197
Here is the call graph for this function: