Jpp
Functions
JShellParser.cc File Reference
#include <iostream>
#include <iomanip>
#include <string>
#include <cstring>
#include <list>
#include "JLang/JNullType.hh"
#include "JLang/JEquation.hh"
#include "JLang/JEquationFacet.hh"
#include "JLang/JException.hh"
#include "JLang/JRedirectStream.hh"
#include "JLang/JLangToolkit.hh"
#include "JSystem/JSystemToolkit.hh"
#include "Jeep/JParser.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Auxiliary program to interface JPARSER::JParser to command line of shell scripts. Syntax:

  eval `JShellParser -o "-a <environment variable> [= <default value>[, <possible value>]]" -- $*`

Definition in file JShellParser.cc.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 445 of file JShellParser.cc.

446 {
447  using namespace std;
448  using namespace JPP;
449 
450  try {
451 
452  JEnvironment<bool> boolean;
453  JEnvironment<string> regular;
454 
455  JParser<> zap;
456 
457  zap['b'] = make_field(boolean) = JPARSER::initialised();
458  zap['o'] = make_field(regular) = JPARSER::initialised();
459 
460  const JArgs options = zap(argc, argv);
461 
462  JShellParser<> buffer;
463 
464  buffer.join(boolean);
465  buffer.join(regular);
466 
467  buffer(options);
468 
469  boolean.evaluate();
470  regular.evaluate();
471  }
472  catch(const exception& error) {
473  return gexit(2, error.what());
474  }
475 }
JEEP::JArgs
Data structure to store command line arguments.
Definition: JArgs.hh:24
JPARSER::initialised
Empty structure for specification of parser element that is initialised (i.e.
Definition: JParser.hh:63
JPARSER::JParser
Utility class to parse command line options.
Definition: JParser.hh:1493
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JAAnetToolkit.hh:37
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1954
std
Definition: jaanetDictionary.h:36
JSYSTEM::gexit
int gexit(int status, const std::string &message="")
Exit method.
Definition: JSystemToolkit.hh:384