1 | // **************************************************************************
|
---|
2 | /** @namespace FACT
|
---|
3 |
|
---|
4 | @brief Namespace to help with some general things in the program initialization
|
---|
5 |
|
---|
6 | */
|
---|
7 | // **************************************************************************
|
---|
8 | #include "FACT.h"
|
---|
9 |
|
---|
10 | #include <iostream>
|
---|
11 |
|
---|
12 | #include <boost/filesystem.hpp>
|
---|
13 |
|
---|
14 | // --------------------------------------------------------------------------
|
---|
15 | //
|
---|
16 | //! Print version information about FACT++
|
---|
17 | //!
|
---|
18 | //! From help2man:
|
---|
19 | //!
|
---|
20 | //! The first line of the --version information is assumed to be in one
|
---|
21 | //! of the following formats:
|
---|
22 | //!
|
---|
23 | //! \verbatim
|
---|
24 | //! - <version>
|
---|
25 | //! - <program> <version>
|
---|
26 | //! - {GNU,Free} <program> <version>
|
---|
27 | //! - <program> ({GNU,Free} <package>) <version>
|
---|
28 | //! - <program> - {GNU,Free} <package> <version>
|
---|
29 | //! \endverbatim
|
---|
30 | //!
|
---|
31 | //! and separated from any copyright/author details by a blank line.
|
---|
32 | //!
|
---|
33 | //! Handle multi-line bug reporting sections of the form:
|
---|
34 | //!
|
---|
35 | //! \verbatim
|
---|
36 | //! - Report <program> bugs to <addr>
|
---|
37 | //! - GNU <package> home page: <url>
|
---|
38 | //! - ...
|
---|
39 | //! \endverbatim
|
---|
40 | //!
|
---|
41 | //! @param name
|
---|
42 | //! name of the program (usually argv[0]). A possible leading "lt-"
|
---|
43 | //! is removed.
|
---|
44 | //!
|
---|
45 | void FACT::PrintVersion(const char *name)
|
---|
46 | {
|
---|
47 | std::string n = boost::filesystem::basename(name);
|
---|
48 | if (n.substr(0, 3)=="lt-")
|
---|
49 | n = n.substr(3);
|
---|
50 |
|
---|
51 | std::cout <<
|
---|
52 | n << " - "PACKAGE_STRING"\n"
|
---|
53 | "\n"
|
---|
54 | "Written by Thomas Bretz et al.\n"
|
---|
55 | "\n"
|
---|
56 | "Report bugs to <"PACKAGE_BUGREPORT">\n"
|
---|
57 | "Home page: "PACKAGE_URL"\n"
|
---|
58 | "\n"
|
---|
59 | "Copyright (C) 2011 by the FACT Collaboration.\n"
|
---|
60 | "This is free software; see the source for copying conditions.\n"
|
---|
61 | << std::endl;
|
---|
62 | }
|
---|