summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnon Gilboa <agilboa@redhat.com>2010-10-17 11:47:34 +0200
committerArnon Gilboa <agilboa@agilboa.usersys.redhat.com>2010-10-17 17:02:49 +0200
commit1d08cc14586beaf8a263a233f5e55902098b99fc (patch)
tree6cee985cde39d39e25a5d6f054ae0e53969fd862
parente8d475745105c526cc5f98ddb0c4dc2d67af8f61 (diff)
downloadspice-1d08cc14586beaf8a263a233f5e55902098b99fc.tar.gz
spice-1d08cc14586beaf8a263a233f5e55902098b99fc.tar.xz
spice-1d08cc14586beaf8a263a233f5e55902098b99fc.zip
spicec: enable multiple CmdLineParser instantiations
Used by controller. One instance at a time, not thread-safe. Add basename() for win32.
-rw-r--r--client/cmd_line_parser.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/client/cmd_line_parser.cpp b/client/cmd_line_parser.cpp
index 3f45551b..a813629d 100644
--- a/client/cmd_line_parser.cpp
+++ b/client/cmd_line_parser.cpp
@@ -53,6 +53,11 @@ CmdLineParser::CmdLineParser(std::string description, bool allow_positional_args
, _positional_args (allow_positional_args)
, _done (false)
{
+ //Enables multiple instantiations. One at a time, not thread-safe.
+ optind = 1;
+ opterr = 1;
+ optopt = 0;
+ optarg = 0;
}
CmdLineParser::~CmdLineParser()