From 0bae47a75488e2fd1bcab8b141976763e4d81e95 Mon Sep 17 00:00:00 2001 From: Unknown Date: Fri, 10 Nov 2017 19:19:07 +0000 Subject: [PATCH 1/9] Define GIT_COMMIT_HASH via cmake or git archive --- .gitattributes | 1 + CMakeLists.txt | 28 ++++++++++++++++++++++++++++ xmrstak/cli/cli-miner.cpp | 2 +- xmrstak/version.hpp | 13 +++++++++++++ 4 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..c71d4e1 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +xmrstak/version.hpp export-subst diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e13aa0..0faa56d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -358,6 +358,34 @@ if(WIN32) set(LIBS ${LIBS} wsock32 ws2_32) endif() +################################################################################ +# Versioning +################################################################################ + +# Get the current working branch +execute_process( + COMMAND git rev-parse --abbrev-ref HEAD + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + OUTPUT_VARIABLE GIT_BRANCH + OUTPUT_STRIP_TRAILING_WHITESPACE +) + +# Get the latest abbreviated commit hash of the working branch +execute_process( + COMMAND git log -1 --format=%h + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + OUTPUT_VARIABLE GIT_COMMIT_HASH + OUTPUT_STRIP_TRAILING_WHITESPACE +) + +if(NOT "${GIT_COMMIT_HASH}" STREQUAL "") + add_definitions("-DGIT_COMMIT_HASH=\"${GIT_COMMIT_HASH}\"") +endif() +if(NOT "${GIT_BRANCH}" STREQUAL "") + add_definitions("-DGIT_BRANCH=\"${GIT_BRANCH}\"") +endif() + + ################################################################################ # Compile & Link ################################################################################ diff --git a/xmrstak/cli/cli-miner.cpp b/xmrstak/cli/cli-miner.cpp index 5c16c1b..d103293 100644 --- a/xmrstak/cli/cli-miner.cpp +++ b/xmrstak/cli/cli-miner.cpp @@ -85,7 +85,7 @@ void help() cout<<" -u, --user USERNAME pool user name or wallet address"< Date: Fri, 10 Nov 2017 20:39:25 +0000 Subject: [PATCH 2/9] Versioning final version --- .gitattributes | 2 +- xmrstak/cli/cli-miner.cpp | 13 +++++----- xmrstak/net/jpsock.cpp | 4 +-- xmrstak/version.cpp | 53 +++++++++++++++++++++++++++++++++++++++ xmrstak/version.hpp | 24 +++++++++--------- 5 files changed, 75 insertions(+), 21 deletions(-) create mode 100644 xmrstak/version.cpp diff --git a/.gitattributes b/.gitattributes index c71d4e1..71ed00d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1 @@ -xmrstak/version.hpp export-subst +xmrstak/version.cpp export-subst diff --git a/xmrstak/cli/cli-miner.cpp b/xmrstak/cli/cli-miner.cpp index d103293..6a6191b 100644 --- a/xmrstak/cli/cli-miner.cpp +++ b/xmrstak/cli/cli-miner.cpp @@ -85,7 +85,7 @@ void help() cout<<" -u, --user USERNAME pool user name or wallet address"<print_str("-------------------------------------------------------------------\n"); - printer::inst()->print_str( XMR_STAK_NAME" " XMR_STAK_VERSION " mining software.\n"); + printer::inst()->print_str(get_version_str_short().c_str()); + printer::inst()->print_str("\n\n"); + printer::inst()->print_str("Brought to you by fireice_uk and psychocrypt under GPLv3.\n"); printer::inst()->print_str("Based on CPU mining code by wolf9466 (heavily optimized by fireice_uk).\n"); #ifndef CONF_NO_CUDA - printer::inst()->print_str("NVIDIA mining code was written by KlausT and psychocrypt.\n"); + printer::inst()->print_str("Original NVIDIA mining code was written by KlausT and psychocrypt.\n"); #endif #ifndef CONF_NO_OPENCL - printer::inst()->print_str("AMD mining code was written by wolf9466.\n"); + printer::inst()->print_str("Original mining code was written by wolf9466.\n"); #endif - printer::inst()->print_str("Brought to you by fireice_uk and psychocrypt under GPLv3.\n\n"); char buffer[64]; - snprintf(buffer, sizeof(buffer), "Configurable dev donation level is set to %.1f %%\n\n", fDevDonationLevel * 100.0); + snprintf(buffer, sizeof(buffer), "\nConfigurable dev donation level is set to %.1f%%\n\n", fDevDonationLevel * 100.0); printer::inst()->print_str(buffer); printer::inst()->print_str("You can use following keys to display reports:\n"); printer::inst()->print_str("'h' - hashrate\n"); diff --git a/xmrstak/net/jpsock.cpp b/xmrstak/net/jpsock.cpp index f6f5c1f..cb586d2 100644 --- a/xmrstak/net/jpsock.cpp +++ b/xmrstak/net/jpsock.cpp @@ -509,8 +509,8 @@ bool jpsock::cmd_login() { char cmd_buffer[1024]; - snprintf(cmd_buffer, sizeof(cmd_buffer), "{\"method\":\"login\",\"params\":{\"login\":\"%s\",\"pass\":\"%s\",\"agent\":\"" AGENTID_STR "\"},\"id\":1}\n", - usr_login.c_str(), usr_pass.c_str()); + snprintf(cmd_buffer, sizeof(cmd_buffer), "{\"method\":\"login\",\"params\":{\"login\":\"%s\",\"pass\":\"%s\",\"agent\":\"%s\"},\"id\":1}\n", + usr_login.c_str(), usr_pass.c_str(), get_version_str().c_str()); opq_json_val oResult(nullptr); diff --git a/xmrstak/version.cpp b/xmrstak/version.cpp new file mode 100644 index 0000000..2308580 --- /dev/null +++ b/xmrstak/version.cpp @@ -0,0 +1,53 @@ +#include "version.hpp" + +//! git will put "#define GIT_ARCHIVE 1" on the next line inside archives. $Format:%n#define GIT_ARCHIVE 1$ +#if defined(GIT_ARCHIVE) && !defined(GIT_COMMIT_HASH) +#define GIT_COMMIT_HASH "$Format:%h$" +#endif + +#ifndef GIT_COMMIT_HASH +#define GIT_COMMIT_HASH "0000000" +#endif + +#ifndef GIT_BRANCH +#define GIT_BRANCH "unknown" +#endif + +#define XMR_STAK_NAME "xmr-stak" +#define XMR_STAK_VERSION "2.0.0" + +#if defined(_WIN32) +#define OS_TYPE "win" +#elif defined(__APPLE__) +#define OS_TYPE "mac" +#elif defined(__FreeBSD__) +#define OS_TYPE "bsd" +#elif defined(__linux__) +#define OS_TYPE "lin" +#else +#define OS_TYPE "unk" +#endif + +#if !defined(CONF_NO_CUDA) && !defined(CONF_NO_OPENCL) +#define BACKEND_TYPE "cpu-nvidia-amd" +#elif !defined(CONF_NO_OPENCL) +#define BACKEND_TYPE "cpu-amd" +#elif !defined(CONF_NO_CUDA) +#define BACKEND_TYPE "cpu-nvidia" +#else +#define BACKEND_TYPE "cpu" +#endif + +#if defined(CONF_NO_AEON) +#define COIN_TYPE "monero" +#elif defined(CONF_NO_MONERO) +#define COIN_TYPE "aeon" +#else +#define COIN_TYPE "aeon-monero" +#endif + +#define VERSION_LONG XMR_STAK_NAME "/" XMR_STAK_VERSION "/" GIT_COMMIT_HASH "/" GIT_BRANCH "/" OS_TYPE "/" BACKEND_TYPE "/" COIN_TYPE "/" +#define VERSION_SHORT XMR_STAK_NAME " " XMR_STAK_VERSION " " GIT_COMMIT_HASH + +const char ver_long[] = VERSION_LONG; +const char ver_short[] = VERSION_SHORT; diff --git a/xmrstak/version.hpp b/xmrstak/version.hpp index 4267c75..72df50b 100644 --- a/xmrstak/version.hpp +++ b/xmrstak/version.hpp @@ -1,17 +1,17 @@ #pragma once -//! git will put "#define GIT_ARCHIVE 1" on the next line inside archives. $Format:%n#define GIT_ARCHIVE 1$ -#if defined(GIT_ARCHIVE) && !defined(GIT_COMMIT_HASH) -#define GIT_COMMIT_HASH "$Format:%h$" -#endif +#include +#include "donate-level.hpp" -#ifndef GIT_COMMIT_HASH -#define GIT_COMMIT_HASH "0000000" -#endif +extern const char ver_long[]; +extern const char ver_short[]; -#ifndef GIT_BRANCH -#define GIT_BRANCH "unknown" -#endif +inline std::string get_version_str() +{ + return std::string(ver_long) + std::to_string(uint(fDevDonationLevel * 1000)) ; +} -#define XMR_STAK_NAME "xmr-stak" -#define XMR_STAK_VERSION "2.0.0-predev" +inline std::string get_version_str_short() +{ + return std::string(ver_short); +} From 71c4e937aeb0a202ea577b52656b68002ba33291 Mon Sep 17 00:00:00 2001 From: Unknown Date: Fri, 10 Nov 2017 20:51:25 +0000 Subject: [PATCH 3/9] fix win build --- CMakeLists.txt | 4 ++-- xmrstak/version.hpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0faa56d..491d7e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -379,10 +379,10 @@ execute_process( ) if(NOT "${GIT_COMMIT_HASH}" STREQUAL "") - add_definitions("-DGIT_COMMIT_HASH=\"${GIT_COMMIT_HASH}\"") + add_definitions("-DGIT_COMMIT_HASH=${GIT_COMMIT_HASH}") endif() if(NOT "${GIT_BRANCH}" STREQUAL "") - add_definitions("-DGIT_BRANCH=\"${GIT_BRANCH}\"") + add_definitions("-DGIT_BRANCH=${GIT_BRANCH}") endif() diff --git a/xmrstak/version.hpp b/xmrstak/version.hpp index 72df50b..2bf38d5 100644 --- a/xmrstak/version.hpp +++ b/xmrstak/version.hpp @@ -1,5 +1,6 @@ #pragma once +#include #include #include "donate-level.hpp" @@ -8,7 +9,7 @@ extern const char ver_short[]; inline std::string get_version_str() { - return std::string(ver_long) + std::to_string(uint(fDevDonationLevel * 1000)) ; + return std::string(ver_long) + std::to_string(uint32_t(fDevDonationLevel * 1000)) ; } inline std::string get_version_str_short() From 062287ad4740fd4ea7365f188d2a31c43b489ab5 Mon Sep 17 00:00:00 2001 From: psychocrypt Date: Sat, 11 Nov 2017 21:43:51 +0100 Subject: [PATCH 4/9] fix compile - generate define `BACKEND_TYPE` type in CMake - fix comile because `GIT_COMMIT_HASH` is no string --- CMakeLists.txt | 8 +++++++- xmrstak/version.cpp | 27 ++++++++++++--------------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 491d7e3..7c56284 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,7 +63,7 @@ if(CUDA_ENABLE) find_package(CUDA 7.5) if(CUDA_FOUND) - + list(APPEND BACKEND_TYPES "nvidia") option(XMR-STAK_LARGEGRID "Support large CUDA block count > 128" ON) if(XMR-STAK_LARGEGRID) add_definitions("-DXMR_STAK_LARGEGRID=${XMR-STAK_LARGEGRID}") @@ -233,6 +233,7 @@ if(OpenCL_ENABLE) # find package will use the previews searched path variables find_package(OpenCL) if(OpenCL_FOUND) + list(APPEND BACKEND_TYPES "amd") include_directories(SYSTEM ${OpenCL_INCLUDE_DIRS}) #set(LIBS ${LIBS} ${OpenCL_LIBRARY}) link_directories(${OpenCL_LIBRARY}) @@ -250,6 +251,8 @@ endif() option(CPU_ENABLE "Enable or disable CPU support" ON) if(NOT CPU_ENABLE) add_definitions("-DCONF_NO_CPU") +else() + list(APPEND BACKEND_TYPES "cpu") endif() ################################################################################ @@ -385,6 +388,9 @@ if(NOT "${GIT_BRANCH}" STREQUAL "") add_definitions("-DGIT_BRANCH=${GIT_BRANCH}") endif() +# generate backend string +string(REPLACE ";" "-" STR_BACKEND_TYPES "${BACKEND_TYPES}") +add_definitions("-DBACKEND_TYPE=${STR_BACKEND_TYPES}") ################################################################################ # Compile & Link diff --git a/xmrstak/version.cpp b/xmrstak/version.cpp index 2308580..3cecc8f 100644 --- a/xmrstak/version.cpp +++ b/xmrstak/version.cpp @@ -2,15 +2,19 @@ //! git will put "#define GIT_ARCHIVE 1" on the next line inside archives. $Format:%n#define GIT_ARCHIVE 1$ #if defined(GIT_ARCHIVE) && !defined(GIT_COMMIT_HASH) -#define GIT_COMMIT_HASH "$Format:%h$" +#define GIT_COMMIT_HASH $Format:%h$ #endif #ifndef GIT_COMMIT_HASH -#define GIT_COMMIT_HASH "0000000" +#define GIT_COMMIT_HASH 0000000 #endif #ifndef GIT_BRANCH -#define GIT_BRANCH "unknown" +#define GIT_BRANCH unknown +#endif + +#ifndef BACKEND_TYPE +#define BACKEND_TYPE unknown #endif #define XMR_STAK_NAME "xmr-stak" @@ -28,16 +32,6 @@ #define OS_TYPE "unk" #endif -#if !defined(CONF_NO_CUDA) && !defined(CONF_NO_OPENCL) -#define BACKEND_TYPE "cpu-nvidia-amd" -#elif !defined(CONF_NO_OPENCL) -#define BACKEND_TYPE "cpu-amd" -#elif !defined(CONF_NO_CUDA) -#define BACKEND_TYPE "cpu-nvidia" -#else -#define BACKEND_TYPE "cpu" -#endif - #if defined(CONF_NO_AEON) #define COIN_TYPE "monero" #elif defined(CONF_NO_MONERO) @@ -46,8 +40,11 @@ #define COIN_TYPE "aeon-monero" #endif -#define VERSION_LONG XMR_STAK_NAME "/" XMR_STAK_VERSION "/" GIT_COMMIT_HASH "/" GIT_BRANCH "/" OS_TYPE "/" BACKEND_TYPE "/" COIN_TYPE "/" -#define VERSION_SHORT XMR_STAK_NAME " " XMR_STAK_VERSION " " GIT_COMMIT_HASH +#define XMRSTAK_PP_TOSTRING1(str) #str +#define XMRSTAK_PP_TOSTRING(str) XMRSTAK_PP_TOSTRING1(str) + +#define VERSION_LONG XMR_STAK_NAME "/" XMR_STAK_VERSION "/" XMRSTAK_PP_TOSTRING(GIT_COMMIT_HASH) "/" XMRSTAK_PP_TOSTRING(GIT_BRANCH) "/" OS_TYPE "/" XMRSTAK_PP_TOSTRING(BACKEND_TYPE) "/" COIN_TYPE "/" +#define VERSION_SHORT XMR_STAK_NAME " " XMR_STAK_VERSION " " XMRSTAK_PP_TOSTRING(GIT_COMMIT_HASH) const char ver_long[] = VERSION_LONG; const char ver_short[] = VERSION_SHORT; From f0875b614c6fe77a70af443052cef07756e135b4 Mon Sep 17 00:00:00 2001 From: psychocrypt Date: Sat, 11 Nov 2017 21:50:26 +0100 Subject: [PATCH 5/9] add cli option `-v/--version` --- doc/usage.md | 1 + xmrstak/cli/cli-miner.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/doc/usage.md b/doc/usage.md index 9a38384..552569f 100644 --- a/doc/usage.md +++ b/doc/usage.md @@ -32,6 +32,7 @@ The miner allow to overwrite some of the settings via command line options. Usage: xmr-stak [OPTION]... -h, --help show this help + -v, --version show version number -c, --config FILE common miner configuration file --currency NAME currency to mine: monero or aeon --noCPU disable the CPU miner backend diff --git a/xmrstak/cli/cli-miner.cpp b/xmrstak/cli/cli-miner.cpp index 6a6191b..6e391d9 100644 --- a/xmrstak/cli/cli-miner.cpp +++ b/xmrstak/cli/cli-miner.cpp @@ -63,6 +63,7 @@ void help() cout<<"Usage: "< Date: Mon, 13 Nov 2017 19:56:41 +0000 Subject: [PATCH 6/9] Add version to web and json --- xmrstak/cli/cli-miner.cpp | 2 +- xmrstak/http/webdesign.cpp | 13 +++++++++++-- xmrstak/misc/executor.cpp | 12 +++++++----- xmrstak/version.cpp | 2 ++ xmrstak/version.hpp | 1 + 5 files changed, 22 insertions(+), 8 deletions(-) diff --git a/xmrstak/cli/cli-miner.cpp b/xmrstak/cli/cli-miner.cpp index 6e391d9..038b51b 100644 --- a/xmrstak/cli/cli-miner.cpp +++ b/xmrstak/cli/cli-miner.cpp @@ -299,7 +299,7 @@ int main(int argc, char *argv[]) } if(opName.compare("-v") == 0 || opName.compare("--version") == 0) { - std::cout<< "Version: " << get_version_str() << std::endl; + std::cout<< "Version: " << get_version_str_short() << std::endl; return 0; } else if(opName.compare("--noCPU") == 0) diff --git a/xmrstak/http/webdesign.cpp b/xmrstak/http/webdesign.cpp index c6fcea6..3b21ae0 100644 --- a/xmrstak/http/webdesign.cpp +++ b/xmrstak/http/webdesign.cpp @@ -1,6 +1,6 @@ #include -extern const char sHtmlCssEtag [] = "00000006"; +extern const char sHtmlCssEtag [] = "00000008"; extern const char sHtmlCssFile [] = "body {" "font-family: Tahoma, Arial, sans-serif;" @@ -38,7 +38,13 @@ extern const char sHtmlCssFile [] = "color: white;" "padding: 10px;" "font-weight: bold;" - "margin: 10px 0px;" + "margin: 0px;" + "margin-bottom: 10px;" + "}" + + ".version {" + "font-size: 75%;" + "text-align: right;" "}" ".links {" @@ -97,6 +103,7 @@ extern const char sHtmlCommonHeader [] = "%s" "" "
" + "
%s
" "
XMR-Stak Monero Miner
" "
" @@ -181,6 +188,8 @@ extern const char sJsonApiConnectionError[] = extern const char sJsonApiFormat [] = "{" + "\"version\":\"%s\"," + "\"hashrate\":{" "\"threads\":[%s]," "\"total\":%s," diff --git a/xmrstak/misc/executor.cpp b/xmrstak/misc/executor.cpp index 931e2aa..7d3a57d 100644 --- a/xmrstak/misc/executor.cpp +++ b/xmrstak/misc/executor.cpp @@ -33,6 +33,7 @@ #include "xmrstak/jconf.hpp" #include "xmrstak/misc/console.hpp" #include "xmrstak/donate-level.hpp" +#include "xmrstak/version.hpp" #include "xmrstak/http/webdesign.hpp" #include @@ -43,6 +44,7 @@ #include #include + #ifdef _WIN32 #define strncasecmp _strnicmp #endif // _WIN32 @@ -814,7 +816,7 @@ void executor::http_hashrate_report(std::string& out) out.reserve(4096); - snprintf(buffer, sizeof(buffer), sHtmlCommonHeader, "Hashrate Report", "Hashrate Report"); + snprintf(buffer, sizeof(buffer), sHtmlCommonHeader, "Hashrate Report", ver_html, "Hashrate Report"); out.append(buffer); snprintf(buffer, sizeof(buffer), sHtmlHashrateBodyHigh, (unsigned int)nthd + 3); @@ -859,7 +861,7 @@ void executor::http_result_report(std::string& out) out.reserve(4096); - snprintf(buffer, sizeof(buffer), sHtmlCommonHeader, "Result Report", "Result Report"); + snprintf(buffer, sizeof(buffer), sHtmlCommonHeader, "Result Report", ver_html, "Result Report"); out.append(buffer); size_t iGoodRes = vMineResults[0].count, iTotalRes = iGoodRes; @@ -905,7 +907,7 @@ void executor::http_connection_report(std::string& out) out.reserve(4096); - snprintf(buffer, sizeof(buffer), sHtmlCommonHeader, "Connection Report", "Connection Report"); + snprintf(buffer, sizeof(buffer), sHtmlCommonHeader, "Connection Report", ver_html, "Connection Report"); out.append(buffer); jpsock* pool = pick_pool_by_id(current_pool_id); @@ -1045,11 +1047,11 @@ void executor::http_json_report(std::string& out) cn_error.append(buffer); } - size_t bb_size = 1024 + hr_thds.size() + res_error.size() + cn_error.size(); + size_t bb_size = 2048 + hr_thds.size() + res_error.size() + cn_error.size(); std::unique_ptr bigbuf( new char[ bb_size ] ); int bb_len = snprintf(bigbuf.get(), bb_size, sJsonApiFormat, - hr_thds.c_str(), hr_buffer, a, + get_version_str().c_str(), hr_thds.c_str(), hr_buffer, a, int_port(iPoolDiff), int_port(iGoodRes), int_port(iTotalRes), fAvgResTime, int_port(iPoolHashes), int_port(iTopDiff[0]), int_port(iTopDiff[1]), int_port(iTopDiff[2]), int_port(iTopDiff[3]), int_port(iTopDiff[4]), int_port(iTopDiff[5]), int_port(iTopDiff[6]), int_port(iTopDiff[7]), int_port(iTopDiff[8]), int_port(iTopDiff[9]), diff --git a/xmrstak/version.cpp b/xmrstak/version.cpp index 3cecc8f..3b8a19d 100644 --- a/xmrstak/version.cpp +++ b/xmrstak/version.cpp @@ -45,6 +45,8 @@ #define VERSION_LONG XMR_STAK_NAME "/" XMR_STAK_VERSION "/" XMRSTAK_PP_TOSTRING(GIT_COMMIT_HASH) "/" XMRSTAK_PP_TOSTRING(GIT_BRANCH) "/" OS_TYPE "/" XMRSTAK_PP_TOSTRING(BACKEND_TYPE) "/" COIN_TYPE "/" #define VERSION_SHORT XMR_STAK_NAME " " XMR_STAK_VERSION " " XMRSTAK_PP_TOSTRING(GIT_COMMIT_HASH) +#define VERSION_HTML "v" XMR_STAK_VERSION "-" XMRSTAK_PP_TOSTRING(GIT_COMMIT_HASH) const char ver_long[] = VERSION_LONG; const char ver_short[] = VERSION_SHORT; +const char ver_html[] = VERSION_HTML; diff --git a/xmrstak/version.hpp b/xmrstak/version.hpp index 2bf38d5..cdf82f3 100644 --- a/xmrstak/version.hpp +++ b/xmrstak/version.hpp @@ -6,6 +6,7 @@ extern const char ver_long[]; extern const char ver_short[]; +extern const char ver_html[]; inline std::string get_version_str() { From 2fe70265070627042a24041eea17e6527d642918 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 13 Nov 2017 20:28:16 +0000 Subject: [PATCH 7/9] Added long version as a separate option --- xmrstak/cli/cli-miner.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xmrstak/cli/cli-miner.cpp b/xmrstak/cli/cli-miner.cpp index 038b51b..b4de18d 100644 --- a/xmrstak/cli/cli-miner.cpp +++ b/xmrstak/cli/cli-miner.cpp @@ -302,6 +302,11 @@ int main(int argc, char *argv[]) std::cout<< "Version: " << get_version_str_short() << std::endl; return 0; } + else if(opName.compare("-V") == 0 || opName.compare("--version-long") == 0) + { + std::cout<< "Version: " << get_version_str() << std::endl; + return 0; + } else if(opName.compare("--noCPU") == 0) { params::inst().useCPU = false; From 48071db7386d50e6418ec8df9d005564c960906a Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 13 Nov 2017 20:31:09 +0000 Subject: [PATCH 8/9] Change attribution --- xmrstak/cli/cli-miner.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xmrstak/cli/cli-miner.cpp b/xmrstak/cli/cli-miner.cpp index b4de18d..da0db15 100644 --- a/xmrstak/cli/cli-miner.cpp +++ b/xmrstak/cli/cli-miner.cpp @@ -449,10 +449,10 @@ int main(int argc, char *argv[]) printer::inst()->print_str("Brought to you by fireice_uk and psychocrypt under GPLv3.\n"); printer::inst()->print_str("Based on CPU mining code by wolf9466 (heavily optimized by fireice_uk).\n"); #ifndef CONF_NO_CUDA - printer::inst()->print_str("Original NVIDIA mining code was written by KlausT and psychocrypt.\n"); + printer::inst()->print_str("Based on NVIDIA mining code by KlausT and psychocrypt.\n"); #endif #ifndef CONF_NO_OPENCL - printer::inst()->print_str("Original mining code was written by wolf9466.\n"); + printer::inst()->print_str("Based on OpenCL mining code by wolf9466.\n"); #endif char buffer[64]; snprintf(buffer, sizeof(buffer), "\nConfigurable dev donation level is set to %.1f%%\n\n", fDevDonationLevel * 100.0); From 04e4d28c98a76e9b0982674fdeb9f27a82a6790e Mon Sep 17 00:00:00 2001 From: psychocrypt Date: Mon, 13 Nov 2017 21:37:28 +0100 Subject: [PATCH 9/9] update help and documentation - update usage.md - hpdate help output --- doc/usage.md | 1 + xmrstak/cli/cli-miner.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/doc/usage.md b/doc/usage.md index 552569f..30d80fa 100644 --- a/doc/usage.md +++ b/doc/usage.md @@ -33,6 +33,7 @@ Usage: xmr-stak [OPTION]... -h, --help show this help -v, --version show version number + -V, --version-long show long version number -c, --config FILE common miner configuration file --currency NAME currency to mine: monero or aeon --noCPU disable the CPU miner backend diff --git a/xmrstak/cli/cli-miner.cpp b/xmrstak/cli/cli-miner.cpp index da0db15..284cf4a 100644 --- a/xmrstak/cli/cli-miner.cpp +++ b/xmrstak/cli/cli-miner.cpp @@ -64,6 +64,7 @@ void help() cout<<" "<