FACT++  1.0
void Configuration::PrintVersion ( ) const
privatevirtual

Print version information about the program and package.

The program name is taken from fName. If a leading "lt-" is found, it is removed. This is useful if the program was build and run using libtool.

The package name is taken from the define PACKAGE_STRING. If it is not defined (like automatically done by autoconf) no package information is printed. The same is true for PACKAGE_URL and PACKAGE_BUGREPORT.

From help2man:

The first line of the –version information is assumed to be in one of the following formats:

//!  - <version>
//!  - <program> <version>
//!  - {GNU,Free} <program> <version>
//!  - <program> ({GNU,Free} <package>) <version>
//!  - <program> - {GNU,Free} <package> <version>
//! 
 and separated from any copyright/author details by a blank line.

Handle multi-line bug reporting sections of the form:
//!  - Report <program> bugs to <addr>
//!  - GNU <package> home page: <url>
//!  - ...
//! 
@param name
    name of the program (usually argv[0]). 

Definition at line 1435 of file Configuration.cc.

References fName, fPrintVersion, PACKAGE_BUGREPORT, PACKAGE_STRING, and PACKAGE_URL.

Referenced by Parse(), and PrintUsage().

1436 {
1437 #ifndef PACKAGE_STRING
1438 #define PACKAGE_STRING ""
1439 #endif
1440 
1441 #ifndef PACKAGE_URL
1442 #define PACKAGE_URL ""
1443 #endif
1444 
1445 #ifndef PACKAGE_BUGREPORT
1446 #define PACKAGE_BUGREPORT ""
1447 #endif
1448 
1449  if (fPrintVersion)
1450  {
1452  return;
1453  }
1454 
1455 #if BOOST_VERSION < 104600
1456  const std::string n = boost::filesystem::path(fName).filename();
1457 #else
1458  const std::string n = boost::filesystem::path(fName).filename().string();
1459 #endif
1460 
1461  const string name = PACKAGE_STRING;
1462  const string bugs = PACKAGE_BUGREPORT;
1463  const string url = PACKAGE_URL;
1464 
1465  cout << n;
1466  if (!name.empty())
1467  cout << " - " << name;
1468  cout <<
1469  "\n\n"
1470  "Written by Thomas Bretz et al.\n"
1471  "\n";
1472  if (!bugs.empty())
1473  cout << "Report bugs to <" << bugs << ">\n";
1474  if (!url.empty())
1475  cout << "Home page: " << url << "\n";
1476  cout <<
1477  "\n"
1478  "Copyright (C) 2011 by the FACT Collaboration.\n"
1479  "This is free software; see the source for copying conditions.\n"
1480  << std::endl;
1481 }
#define PACKAGE_BUGREPORT
#define PACKAGE_STRING
std::function< void(const std::string &)> fPrintVersion
Definition: Configuration.h:52
#define PACKAGE_URL
const std::string fName
Definition: Configuration.h:19

+ Here is the caller graph for this function: