X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMainLayer.cc;h=2e687855dd73d03a557bcf2108d9940d1706ed4c;hp=c5a93864a57f24e34cbfa1df103409d10ae1864b;hb=31d52677b38d935297d132bdbd956c655cd3feee;hpb=9380d855c739df67d9af175f1d36ebec30346dda diff --git a/src/MainLayer.cc b/src/MainLayer.cc index c5a9386..2e68785 100644 --- a/src/MainLayer.cc +++ b/src/MainLayer.cc @@ -29,6 +29,7 @@ #include // atexit, getenv #include #include +#include // access #include #include @@ -189,14 +190,39 @@ void printUsage() << "See documentation for more options." << std::endl; } -void printInfo() +void printInfo(int argc, char* argv[]) { - std::cout << PACKAGE_STRING << std::endl + std::string assets; + std::string datadir; + std::string config; + + assets.assign(YOINK_DATADIR); + int accessible = access(assets.c_str(), R_OK); + if (accessible != 0) assets += " (no access)"; + + char* temp = getenv("YOINK_DATADIR"); + if (temp) + { + datadir = temp; + accessible = access(temp, R_OK); + if (accessible != 0) datadir += " (no access)"; + } + + temp = getenv("YOINKRC"); + if (temp) + { + config = temp; + accessible = access(temp, R_OK); + if (accessible != 0) config += " (no access)"; + } + + std::cout << " Executable: " << argv[0] << std::endl + << " Version: "VERSION << std::endl #ifdef __DATE__ - << "When compiled: "__DATE__" "__TIME__ << std::endl + << " Built: "__DATE__" "__TIME__ << std::endl #endif - << "Compiler: "COMPILER_STRING << std::endl - << "Asset directory: "YOINK_DATADIR << std::endl + << " Compiler: "COMPILER_STRING << std::endl + << " Assets: " << assets << std::endl << "Build options: " #ifdef NDEBUG << "-" @@ -213,11 +239,9 @@ void printInfo() #ifndef USE_THREADS << "-" #endif - << "threads " - << std::endl; -#if !defined (_WIN32) && !defined(__WIN32__) - system("uname -a"); -#endif + << "threads" << std::endl + << " YOINKRC: " << config << std::endl + << "YOINK_DATADIR: " << datadir << std::endl; } void goodbye() @@ -239,7 +263,7 @@ int main(int argc, char* argv[]) } else if (arg == "-i" || arg == "--info") { - printInfo(); + printInfo(argc, argv); return 0; } }