* Returns a string containing a version reference of the build. * If a git checkout is discovered, flags identifying if there are * uncommitted changes will be present too. * * @param component An additional string identifying which component this * version reference belongs to. Normally argv[0]. * * @return A pre-formatted std::string containing the version reference
| 101 | * @return A pre-formatted std::string containing the version references |
| 102 | */ |
| 103 | std::string get_version(std::string component) |
| 104 | { |
| 105 | std::stringstream ver; |
| 106 | |
| 107 | ver << PACKAGE_NAME << " " << package_version; |
| 108 | |
| 109 | // Simplistic basename() approach, extracting just the filename |
| 110 | // of the binary from argv[0] |
| 111 | ver << " (" << simple_basename(component) << ")" |
| 112 | << std::endl; |
| 113 | |
| 114 | #if defined(OPENVPN_TUN_BUILDER_BASE_H) |
| 115 | ver << ClientAPI::OpenVPNClient::platform() << std::endl; |
| 116 | #else |
| 117 | ver << openvpn::platform_string(); |
| 118 | #if defined(OPENVPN_DEBUG) |
| 119 | #if defined(ENABLE_OVPNDCO) |
| 120 | ver << " [DCO]"; |
| 121 | #endif |
| 122 | ver << " built on " __DATE__ " " __TIME__; |
| 123 | #endif // OPENVPN_DEBUG |
| 124 | #endif // OPENVPN_TUN_BUILDER_BASE_H |
| 125 | ver << std::endl |
| 126 | << openvpn_copyright; |
| 127 | |
| 128 | return ver.str(); |
| 129 | } |
| 130 | |
| 131 | |
| 132 | const std::string get_guiversion() |
no test coverage detected