From 162121941f6d7bccc4c8f4e98431441e0afe8460 Mon Sep 17 00:00:00 2001 From: Jan Darmochwal Date: Thu, 4 Nov 2010 14:02:39 +0100 Subject: Config option: pool * formerly vmchooser_env in vmchooser.conf * pool/vmchooser_env in vmchooser.conf * -P/--pools command line option * a virtual session will only be displayed if a) their pools attribute contains pool b) their pools attribute is unset/empty c) pool is unset/empty * fix for segfault with invalid command line options --- src/command_line_options.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/command_line_options.cpp') diff --git a/src/command_line_options.cpp b/src/command_line_options.cpp index 4ee6520..61eb3ad 100644 --- a/src/command_line_options.cpp +++ b/src/command_line_options.cpp @@ -7,14 +7,16 @@ CommandLineOptions::CommandLineOptions(int argc, char * const argv[]) { static const struct option longOptions[] = { {"config", required_argument, NULL, 'c'}, {"default", required_argument, NULL, 'd'}, + {"pool", required_argument, NULL, 'P'}, {"path", required_argument, NULL, 'p'}, {"xpath", required_argument, NULL, 'x'}, {"size", required_argument, NULL, 's'}, {"version", no_argument, NULL, 'v'}, - {"help", no_argument, NULL, 'h'} + {"help", no_argument, NULL, 'h'}, + {0, 0, 0, 0} }; - int opt = getopt_long(argc, argv, "c:d:p:x:s:vhb", longOptions, NULL); + int opt = getopt_long(argc, argv, "c:d:P:p:x:s:vhb", longOptions, NULL); if (opt == -1) break; switch (opt) { @@ -24,6 +26,9 @@ CommandLineOptions::CommandLineOptions(int argc, char * const argv[]) { case 'd': options.insert("default", optarg); break; + case 'P': + options.insert("pool", optarg); + break; case 'p': options.insert("path", optarg); break; -- cgit v1.2.3-55-g7522