Jpp  17.1.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
getGITTags.cc
Go to the documentation of this file.
1 
2 #include <string>
3 #include <iostream>
4 #include <iomanip>
5 
6 #include "Jeep/JGITTags.hh"
7 
8 #include "Jeep/JPrint.hh"
9 #include "Jeep/JParser.hh"
10 #include "Jeep/JMessage.hh"
11 
12 
13 /**
14  * \file
15  *
16  * Auxiliary program to print GIT tags.
17  * \author mdejong
18  */
19 int main(int argc, char **argv)
20 {
21  using namespace std;
22  using namespace JPP;
23 
24  JGITTags_t::key_type date;
25  int debug;
26 
27  try {
28 
29  JParser<> zap("Auxiliary program to print GIT tags.");
30 
31  zap['D'] = make_field(date, "start date \"YYYY-MM-DD\"") = JGITTags_t::key_type::min();
32  zap['d'] = make_field(debug) = 1;
33 
34  zap(argc, argv);
35  }
36  catch(const exception &error) {
37  FATAL(error.what() << endl);
38  }
39 
40  const JGITTags_t buffer = getGITTags();
41 
42  for (JGITTags_t::const_iterator i = buffer.lower_bound(date); i != buffer.end(); ++i) {
43  cout << i->first << ' ' << i->second << endl;
44  }
45 }
Utility class to parse command line options.
Definition: JParser.hh:1517
int main(int argc, char *argv[])
Definition: Main.cc:15
std::vector< std::string > getGITTags(const TRegexp &regexp, const JGITTags_t::key_type &date)
Get selection of GIT tags.
std::multimap< JDate<'-'>, std::string > JGITTags_t
Type definition of dated GIT tags.
I/O formatting auxiliaries.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1993
Dates GIT tags.
General purpose messaging.
#define FATAL(A)
Definition: JMessage.hh:67
Utility class to parse command line options.
int debug
debug level