summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorNiklas2011-10-21 14:30:36 +0200
committerNiklas2011-10-21 14:30:36 +0200
commitd3981804f31fb842d37607c7db58f9b977ba366e (patch)
tree41d0c3d7a69d93b00a08e6cc2ff67163118535ea /src/main.cpp
parentnow the two versions of the NetworkDiscovery code should be the same (except ... (diff)
downloadfbgui-d3981804f31fb842d37607c7db58f9b977ba366e.tar.gz
fbgui-d3981804f31fb842d37607c7db58f9b977ba366e.tar.xz
fbgui-d3981804f31fb842d37607c7db58f9b977ba366e.zip
added some config possibilities
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp45
1 files changed, 44 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index e408a33..2df76a6 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -53,7 +53,12 @@ int main(int argc, char *argv[]) {
required_argument, NULL, 'u' }, { "download", required_argument, NULL, 'd' }, { "serial",
required_argument, NULL, 's' }, { "trigger", required_argument, NULL, 't' }, { "debug",
required_argument, NULL, 'D' }, { "help", no_argument, NULL, 'h' }, { "log",
- required_argument, NULL, 'l' } };
+ required_argument, NULL, 'l' },
+ { "server", required_argument, NULL, 'S' },
+ { "autoup", no_argument, NULL, 'a' },
+ { "socketserverpath", required_argument, NULL, 'p' },
+ { "pathtoexe", required_argument, NULL, 'e' }
+ };
int opt = getopt_long(argc, argv, optString, longOpts, &longIndex);
while (opt != -1) {
switch (opt) {
@@ -81,6 +86,18 @@ int main(int argc, char *argv[]) {
case 'h':
clOpts.insert("help", "help");
break;
+ case 'S':
+ clOpts.insert("server", optarg);
+ break;
+ case 'a':
+ clOpts.insert("autoup", "autoup");
+ break;
+ case 'p':
+ clOpts.insert("socketserverpath", optarg);
+ break;
+ case 'e':
+ clOpts.insert("pathtoexe", optarg);
+ break;
}
opt = getopt_long(argc, argv, optString, longOpts, &longIndex);
}
@@ -175,6 +192,32 @@ int main(int argc, char *argv[]) {
else
logFilePath = DEFAULT_LOG_FILE_PATH;
+ //
+ if (clOpts.contains("server"))
+ gServerIp = clOpts.value("server");
+ else
+ gServerIp = "209.85.148.105"; //that is a google server. change this to a proper default address
+
+ //
+ if (clOpts.contains("autoup"))
+ gAutoUp = true;
+ else
+ gAutoUp = false;
+
+ //
+ if (clOpts.contains("socketserverpath"))
+ gSocketServerPath = clOpts.value("socketserverpath");
+ else
+ gSocketServerPath = DEFAULT_QTSOCKETADDRESS;
+
+ //
+ if (clOpts.contains("pathtoexe"))
+ gPathToDhcpExe = clOpts.value("pathtoexe");
+ else
+ gPathToDhcpExe = DEFAULT_PATHTODHCPCDEXE;
+
+
+
// write always a log file
// // activate file logger if debug mode activated.
// if (debugMode > -1) {