Comment
Author: Admin | 2025-04-28
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 25 26 27 28 29 #if defined(_WIN32) 30 #define _WINSOCKAPI_ 31 #include 32 #endif // defined(_WIN32) 33 34 #include 35 37 38 using namespace std; 39 using namespace dev; 42 43 #undef RETURN 44 46 { 47 cout 48 "Usage ethminer [OPTIONS]" 49 "Options:" 51 cout 52 "General Options:" 53 " -v,--verbosity Set the log verbosity from 0 to 9 (default: 8)." 54 " -V,--version Show the version and exit." 55 " -h,--help Show this help message and exit." 56 ; 57 exit(0); 58 } 59 61 { 62 cout "ethminer version " dev::Version 63 cout "Build: " DEV_QUOTED(ETH_BUILD_PLATFORM) "/" DEV_QUOTED(ETH_BUILD_TYPE) 64 exit(0); 65 } 66 67 68 69 70 71 72 73 74 75 76 77 78 79 81 { 82 #if __unix__ 83 if (!std::setlocale(LC_ALL, "")) 84 { 85 setenv("LC_ALL", "C", 1); 86 } 87 #endif 88 } 89 90 int main(int argc, char** argv) 91 { 94 95 for (int i = 1; i 96 { 97 string arg = argv[i]; 99 {} 100 else if ((arg == "-v" || arg == "--verbosity") && i + 1 102 else if (arg == "-h" || arg == "--help") 104 else if (arg == "-V" || arg == "--version") 106 else 107 { 108 cerr "Invalid argument: " 109 exit(-1); 110 } 111 } 112 114 115 return 0; 116 }Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Origi...std::hash for asio::adress static void streamHelp(ostream &_out)void setDefaultOrCLocale()int main(int argc, char **argv)bool interpretOption(int &i, int argc, char **argv)int g_logVerbosityThe logging system's current verbosity. int atoi(const std::string &str)
Add Comment