summaryrefslogtreecommitdiff
path: root/fancy_getopt.py
diff options
context:
space:
mode:
authorGreg Ward <gward@python.net>2000-08-07 00:45:51 +0000
committerGreg Ward <gward@python.net>2000-08-07 00:45:51 +0000
commitd6bdb1ca69a126e1c651d06d304c283ca304254a (patch)
treea44baf15f43140a04656d546ee31b4b81686b964 /fancy_getopt.py
parent177d3705cc1ffcd1b068776baea88dd5f44259cb (diff)
downloadpython-setuptools-git-d6bdb1ca69a126e1c651d06d304c283ca304254a.tar.gz
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).
Diffstat (limited to 'fancy_getopt.py')
-rw-r--r--fancy_getopt.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/fancy_getopt.py b/fancy_getopt.py
index 6adfc819..a62bc0df 100644
--- a/fancy_getopt.py
+++ b/fancy_getopt.py
@@ -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