From 2132211f5d11fe7eac3f2540eaa90f5c3bcfae1e Mon Sep 17 00:00:00 2001 From: Bastian Wissler Date: Tue, 14 Oct 2008 10:32:04 +0000 Subject: openslx-src-tools/vmchooser: * removed group argument / * added version flag -> version information git-svn-id: http://svn.openslx.org/svn/openslx/openslx-src-tools/vmchooser/trunk@2292 95ad53e4-c205-0410-b2fa-d234c58c8868 --- vmchooser/inc/SWindow.h | 4 ++-- vmchooser/main.cxx | 34 +++++++++++++++------------------- 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/vmchooser/inc/SWindow.h b/vmchooser/inc/SWindow.h index 052d328..321c228 100644 --- a/vmchooser/inc/SWindow.h +++ b/vmchooser/inc/SWindow.h @@ -82,8 +82,8 @@ public: void cb_return(); void cb_select(); - void set_entries(DataEntry** ent, char* slxgroup); - void set_lin_entries(DataEntry** ent, char* slxgroup); + void set_entries(DataEntry** ent); + void set_lin_entries(DataEntry** ent); const char** get_symbol(DataEntry* dat); diff --git a/vmchooser/main.cxx b/vmchooser/main.cxx index e941d53..23fde59 100644 --- a/vmchooser/main.cxx +++ b/vmchooser/main.cxx @@ -25,7 +25,7 @@ using namespace fltk; int main(int argc, char** argv) { AnyOption* opt = new AnyOption(); char* xmlpath = NULL; - //char* slxgroup = NULL; + bool version = false; char* lsesspath = NULL; int width=0, height=0; @@ -36,15 +36,15 @@ int main(int argc, char** argv) { opt->addUsage("SessionChooser Usage:"); opt->addUsage("\t{-p |--path=} path to vmware (.xml) files"); opt->addUsage("\t{-l |--lpath=} path to linux session (.desktop) files"); - opt->addUsage("\t{-g |--group=} group name"); opt->addUsage("\t{-s |--size=} [widthxheight]"); + opt->addUsage("\t{-v |--version} print out version"); opt->addUsage("\t{-h |--help} prints help"); opt->addUsage(""); opt->setFlag("help",'h'); opt->setOption("path", 'p'); opt->setOption("lpath", 'l'); - opt->setOption("group",'g'); + opt->setFlag("version",'v'); opt->setOption("size",'s'); opt->processCommandArgs(argc, argv); @@ -66,21 +66,11 @@ int main(int argc, char** argv) { // Default Path comes here xmlpath = (char *) "/var/lib/vmware/vmconfigs/"; } - - /** SLX GROUP - OBSOLETE */ - /** NOW THE SLX GROUP SHOULD BE SET THROUGH THE PLUGIN OPTIONS */ - //if(opt->getValue('g')!=NULL) { - // slxgroup = opt->getValue('g'); - //} - // - //if(opt->getValue("group")!= NULL) { - // slxgroup = opt->getValue("group"); - //} - //if (slxgroup == NULL) { - // // there should be a generic way to handle these groups - // slxgroup = (char *) "default"; - //} - /** OBSOLETE */ + + /* VERSION */ + if(opt->getFlag('v') || opt->getFlag("version")) { + version = true; + } /** LINUX SESSION PATH */ if(opt->getValue('l')!=NULL) { @@ -120,6 +110,12 @@ int main(int argc, char** argv) { delete opt; + cout << "virtual machine chooser 0.0.1"<< endl; + if(version) { + exit(1); + } + + /* read xml files */ DataEntry** sessions = NULL; DataEntry** lsessions = NULL; @@ -129,7 +125,7 @@ int main(int argc, char** argv) { fprintf(stderr,"Please give a path to xml directory for session images!"); exit(1); } - lsessions = readLinSess(lsesspath); + lsessions = readLinSess(lsesspath); SWindow& win = *SWindow::getInstance(width, height); -- cgit v1.2.3-55-g7522