# # # patch "ChangeLog" # from [c732483a3760fbd4aad04c00de8d5696af2296d1] # to [8dc885edbcfd2a6b3e0f4bb987f688060cec2eda] # # patch "mt_version.cc" # from [1fd710d9b26d3589a6ca20ec37f413eb0770272d] # to [62909be1f34c2e92ea4e83cdeac2b535f482e2e4] # # patch "mt_version.hh" # from [97653829bb79aa2d63c4315e79199d9297681b3d] # to [fa5cb0e543a67f11896bfe970d5f0628b3c44b79] # ============================================================ --- ChangeLog c732483a3760fbd4aad04c00de8d5696af2296d1 +++ ChangeLog 8dc885edbcfd2a6b3e0f4bb987f688060cec2eda @@ -1,5 +1,10 @@ 2006-04-04 Nathaniel Smith + * mt_version.{cc,hh} (get_version, get_full_version): New + functions. Also tweak --full-version output for readability. + +2006-04-04 Nathaniel Smith + * mt_version.cc (print_full_version): Include compiler vendor/version, c++ stdlib vendor/version, and boost version in --full-version output. ============================================================ --- mt_version.cc 1fd710d9b26d3589a6ca20ec37f413eb0770272d +++ mt_version.cc 62909be1f34c2e92ea4e83cdeac2b535f482e2e4 @@ -10,6 +10,7 @@ #include "config.h" #include +#include #include #include @@ -21,28 +22,46 @@ #include "sanity.hh" void +get_version(std::string & out) +{ + out = (F("%s (base revision: %s") + % PACKAGE_STRING % package_revision_constant).str(); +} + +void print_version() { - std::cout << (F("%s (base revision: %s)") - % PACKAGE_STRING % package_revision_constant) - << std::endl; + std::string s; + get_version(s); + std::cout << s << std::endl; } void -print_full_version() +get_full_version(std::string & out) { - print_version(); + std::ostringstream oss; std::string s; + get_version(s); + oss << s << "\n"; get_system_flavour(s); - std::cout << F("Running on: %s\n" - "C++ compiler: %s\n" - "C++ standard library: %s\n" - "Boost version: %s\n" - "Changes since base revision:\n" - "%s\n") + oss << F("Running on : %s\n" + "C++ compiler : %s\n" + "C++ standard library: %s\n" + "Boost version : %s\n" + "Changes since base revision:\n" + "%s") % s % BOOST_COMPILER % BOOST_STDLIB % BOOST_LIB_VERSION % package_full_revision_constant; + out = oss.str(); } + +void +print_full_version() +{ + std::string s; + get_full_version(s); + std::cout << s << std::endl; +} ============================================================ --- mt_version.hh 97653829bb79aa2d63c4315e79199d9297681b3d +++ mt_version.hh fa5cb0e543a67f11896bfe970d5f0628b3c44b79 @@ -6,7 +6,11 @@ // licensed to the public under the terms of the GNU GPL (>= 2) // see the file COPYING for details +#include + +void get_version(std::string & out); void print_version(); +void get_full_version(std::string & out); void print_full_version(); #endif