[eit.commands.bump] filter out last argument from outcome to avoid looping

This commit is contained in:
Fabio Erculiani
2011-10-28 21:30:09 +02:00
parent aa698b4a6d
commit 19aa227f9e

View File

@@ -59,7 +59,8 @@ class EitBump(EitCommand):
def _startswith(string):
if last_arg is not None:
return string.startswith(last_arg)
if last_arg not in outcome:
return string.startswith(last_arg)
return True
if self._args:
@@ -67,6 +68,10 @@ class EitBump(EitCommand):
# something after this.NAME.
outcome = sorted(filter(_startswith, outcome))
for arg in self._args:
if arg in outcome:
outcome.remove(arg)
sys.stdout.write(" ".join(outcome) + "\n")
sys.stdout.flush()