From d8d4e9bfc9c9adde5daad13f177f7f745249f527 Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Fri, 9 Mar 2012 15:10:28 +0100 Subject: [PATCH] cec-client: only read persisted EEPROM settings when -r or --rom is provided as cmdline arg. bugzid: 543 --- src/testclient/main.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/testclient/main.cpp b/src/testclient/main.cpp index de96e0d..964cf68 100644 --- a/src/testclient/main.cpp +++ b/src/testclient/main.cpp @@ -214,6 +214,7 @@ void ShowHelpCommandLine(const char* strExec) " -b --base {int} The logical address of the device to with this " << endl << " adapter is connected." << endl << " -f --log-file {file} Writes all libCEC log message to a file" << endl << + " -r --rom Read persisted settings from the EEPROM" << endl << " -sf --short-log-file {file} Writes all libCEC log message without timestamps" << endl << " and log levels to a file." << endl << " -d --log-level {level} Sets the log level. See cectypes.h for values." << endl << @@ -1014,6 +1015,13 @@ bool ProcessCommandLineArguments(int argc, char *argv[]) } ++iArgPtr; } + else if (!strcmp(argv[iArgPtr], "-r") || + !strcmp(argv[iArgPtr], "--rom")) + { + cout << "using settings from EEPROM" << endl; + g_config.bGetSettingsFromROM = 1; + ++iArgPtr; + } else { g_strPort = argv[iArgPtr++]; @@ -1034,7 +1042,6 @@ int main (int argc, char *argv[]) g_callbacks.CBCecKeyPress = &CecKeyPress; g_callbacks.CBCecCommand = &CecCommand; g_config.callbacks = &g_callbacks; - g_config.bGetSettingsFromROM = 1; if (!ProcessCommandLineArguments(argc, argv)) return 0; -- 2.34.1