Kaydet (Commit) 0fd2dd6d authored tarafından Greg Ward's avatar Greg Ward

Fix so we clear or reinitialize various data structures before populating

(allows the same FancyGetopt object to be used multiple times with different
option tables).
üst f9d20c37
......@@ -93,6 +93,7 @@ class FancyGetopt:
def _build_index (self):
self.option_index.clear()
for option in self.option_table:
self.option_index[option[0]] = option
......@@ -153,6 +154,10 @@ class FancyGetopt:
the option table. Called by 'getopt()' before it can do
anything worthwhile."""
self.long_opts = []
self.short_opts = []
self.short2long.clear()
for option in self.option_table:
try:
(long, short, help) = option
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment