summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/main.cpp b/src/main.cpp
index e646620..2c80919 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -31,15 +31,16 @@ int main(int argc, char *argv[]) {
std::string usage(
a.translate("Console", "Usage: vmchooser [ OPTIONS ]\n\n"
+ " -b --base base directory where VM images are accessible\n"
" -d, --default name of default session\n"
" -c, --config alternative config file\n"
- " -e, --env name of the environment\n"
+ " -P, --pool one or more pool names to display (comma separated)\n"
" -f, --file direct boot .desktop file\n"
" -x, --xpath path of X Session .desktop files\n"
" -u, --url url of vmware .xml file\n"
" -s, --size window size <width>x<height>\n"
" -t, --theme theme\n"
- " -b, --pvs show pvs options\n"
+ " -p, --pvs show pvs options\n"
" -D, --debug print debug information\n"
" -v, --version print version and exit\n"
" -h, --help print usage information and exit\n"
@@ -94,6 +95,7 @@ int main(int argc, char *argv[]) {
} else {
confFile = globalConfFile;
}
+ // TODO: This is the system wide settings, give proper name
QSettings settings(confFile, QSettings::IniFormat);
settings.setIniCodec("UTF-8");
@@ -106,12 +108,6 @@ int main(int argc, char *argv[]) {
defaultSession = ChooserSettings::getSetting("last-session");
}
- if (cmdOptions.contains("path")) {
- vSessionPath = cmdOptions.value("path");
- } else if (settings.contains("path")) {
- vSessionPath = settings.value("path").toString();
- } // else keep default path
-
if (cmdOptions.contains("xpath")) {
xSessionPath = cmdOptions.value("xpath");
} else if (settings.contains("xpath")) {
@@ -171,8 +167,8 @@ int main(int argc, char *argv[]) {
height = VMCHOOSER_DEFAULT_HEIGHT;
}
- if (cmdOptions.contains("env")) {
- pool = cmdOptions.value("env");
+ if (cmdOptions.contains("pool")) {
+ pool = cmdOptions.value("pool");
} else if (settings.contains("pool")) {
pool = settings.value("pool").toString();
}
@@ -187,6 +183,12 @@ int main(int argc, char *argv[]) {
debugMode = true;
}
+ if (cmdOptions.contains("base")) {
+ basePath = cmdOptions.value("base");
+ } else if (settings.contains("base")) {
+ basePath = settings.value("base").toString();
+ }
+
/* read session files */
QList<Session*> xsessions(XSession::readSessions(xSessionPath));