Added command line option --pause-on-battery and renamed config option.
This commit is contained in:
parent
6484bbb716
commit
32e9b7e34a
10 changed files with 32 additions and 25 deletions
|
@ -61,13 +61,13 @@ const char *BaseConfig::kColors = "colors";
|
|||
const char *BaseConfig::kDryRun = "dry-run";
|
||||
const char *BaseConfig::kHttp = "http";
|
||||
const char *BaseConfig::kLogFile = "log-file";
|
||||
const char *BaseConfig::kPauseOnBattery = "pause-on-battery";
|
||||
const char *BaseConfig::kPrintTime = "print-time";
|
||||
const char *BaseConfig::kSyslog = "syslog";
|
||||
const char *BaseConfig::kTitle = "title";
|
||||
const char *BaseConfig::kUserAgent = "user-agent";
|
||||
const char *BaseConfig::kVerbose = "verbose";
|
||||
const char *BaseConfig::kWatch = "watch";
|
||||
const char *BaseConfig::kMineOnBattery = "mine-on-battery";
|
||||
|
||||
|
||||
#ifdef XMRIG_FEATURE_TLS
|
||||
|
@ -86,16 +86,16 @@ bool xmrig::BaseConfig::read(const IJsonReader &reader, const char *fileName)
|
|||
return false;
|
||||
}
|
||||
|
||||
m_autoSave = reader.getBool(kAutosave, m_autoSave);
|
||||
m_background = reader.getBool(kBackground, m_background);
|
||||
m_dryRun = reader.getBool(kDryRun, m_dryRun);
|
||||
m_syslog = reader.getBool(kSyslog, m_syslog);
|
||||
m_watch = reader.getBool(kWatch, m_watch);
|
||||
m_mineOnBattery = reader.getBool(kMineOnBattery, m_mineOnBattery);
|
||||
m_logFile = reader.getString(kLogFile);
|
||||
m_userAgent = reader.getString(kUserAgent);
|
||||
m_printTime = std::min(reader.getUint(kPrintTime, m_printTime), 3600U);
|
||||
m_title = reader.getValue(kTitle);
|
||||
m_autoSave = reader.getBool(kAutosave, m_autoSave);
|
||||
m_background = reader.getBool(kBackground, m_background);
|
||||
m_dryRun = reader.getBool(kDryRun, m_dryRun);
|
||||
m_syslog = reader.getBool(kSyslog, m_syslog);
|
||||
m_watch = reader.getBool(kWatch, m_watch);
|
||||
m_pauseOnBattery = reader.getBool(kPauseOnBattery, m_pauseOnBattery);
|
||||
m_logFile = reader.getString(kLogFile);
|
||||
m_userAgent = reader.getString(kUserAgent);
|
||||
m_printTime = std::min(reader.getUint(kPrintTime, m_printTime), 3600U);
|
||||
m_title = reader.getValue(kTitle);
|
||||
|
||||
# ifdef XMRIG_FEATURE_TLS
|
||||
m_tls = reader.getValue(kTls);
|
||||
|
|
|
@ -55,13 +55,13 @@ public:
|
|||
static const char *kDryRun;
|
||||
static const char *kHttp;
|
||||
static const char *kLogFile;
|
||||
static const char *kPauseOnBattery;
|
||||
static const char *kPrintTime;
|
||||
static const char *kSyslog;
|
||||
static const char *kTitle;
|
||||
static const char *kUserAgent;
|
||||
static const char *kVerbose;
|
||||
static const char *kWatch;
|
||||
static const char* kMineOnBattery;
|
||||
|
||||
# ifdef XMRIG_FEATURE_TLS
|
||||
static const char *kTls;
|
||||
|
@ -72,6 +72,7 @@ public:
|
|||
inline bool isAutoSave() const { return m_autoSave; }
|
||||
inline bool isBackground() const { return m_background; }
|
||||
inline bool isDryRun() const { return m_dryRun; }
|
||||
inline bool isPauseOnBattery() const { return m_pauseOnBattery; }
|
||||
inline bool isSyslog() const { return m_syslog; }
|
||||
inline const char *logFile() const { return m_logFile.data(); }
|
||||
inline const char *userAgent() const { return m_userAgent.data(); }
|
||||
|
@ -81,7 +82,6 @@ public:
|
|||
inline const String &apiWorkerId() const { return m_apiWorkerId; }
|
||||
inline const Title &title() const { return m_title; }
|
||||
inline uint32_t printTime() const { return m_printTime; }
|
||||
inline bool mineOnBattery() const { return m_mineOnBattery; }
|
||||
|
||||
# ifdef XMRIG_FEATURE_TLS
|
||||
inline const TlsConfig &tls() const { return m_tls; }
|
||||
|
@ -97,13 +97,13 @@ public:
|
|||
void printVersions();
|
||||
|
||||
protected:
|
||||
bool m_autoSave = true;
|
||||
bool m_background = false;
|
||||
bool m_dryRun = false;
|
||||
bool m_syslog = false;
|
||||
bool m_upgrade = false;
|
||||
bool m_watch = true;
|
||||
bool m_mineOnBattery = true;
|
||||
bool m_autoSave = true;
|
||||
bool m_background = false;
|
||||
bool m_dryRun = false;
|
||||
bool m_pauseOnBattery = false;
|
||||
bool m_syslog = false;
|
||||
bool m_upgrade = false;
|
||||
bool m_watch = true;
|
||||
Http m_http;
|
||||
Pools m_pools;
|
||||
String m_apiId;
|
||||
|
|
|
@ -247,6 +247,7 @@ void xmrig::BaseTransform::transform(rapidjson::Document &doc, int key, const ch
|
|||
case IConfig::HttpEnabledKey: /* --http-enabled */
|
||||
case IConfig::DaemonKey: /* --daemon */
|
||||
case IConfig::VerboseKey: /* --verbose */
|
||||
case IConfig::PauseOnBatteryKey: /* --pause-on-battery */
|
||||
return transformBoolean(doc, key, true);
|
||||
|
||||
case IConfig::ColorKey: /* --no-color */
|
||||
|
@ -305,6 +306,9 @@ void xmrig::BaseTransform::transformBoolean(rapidjson::Document &doc, int key, b
|
|||
case IConfig::NoTitleKey: /* --no-title */
|
||||
return set(doc, BaseConfig::kTitle, enable);
|
||||
|
||||
case IConfig::PauseOnBatteryKey: /* --pause-on-battery */
|
||||
return set(doc, BaseConfig::kPauseOnBattery, enable);
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -76,6 +76,7 @@ public:
|
|||
DataDirKey = 1035,
|
||||
TitleKey = 1037,
|
||||
NoTitleKey = 1038,
|
||||
PauseOnBatteryKey = 1041,
|
||||
|
||||
// xmrig common
|
||||
CPUPriorityKey = 1021,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue