[Spice-devel] [PATCH spice 5/9] spicec: enable multiple CmdLineParser instantiations

Arnon Gilboa agilboa at redhat.com
Sun Oct 17 08:25:24 PDT 2010


Used by controller. One instance at a time, not thread-safe.
Add basename() for win32.
---
 client/cmd_line_parser.cpp |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/client/cmd_line_parser.cpp b/client/cmd_line_parser.cpp
index 3f45551..a813629 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()
-- 
1.5.5.6



More information about the Spice-devel mailing list