BIND 10 trac384, updated. c78659bd80e45ddb44b3cafb4937aa7b4e5f1b14 [trac384] improve tab-completion suggestions

BIND 10 source code commits bind10-changes at lists.isc.org
Fri Feb 18 11:02:55 UTC 2011


The branch, trac384 has been updated
       via  c78659bd80e45ddb44b3cafb4937aa7b4e5f1b14 (commit)
      from  05f49a93714de9a09ad1c0a9d6e2a7365e890232 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit c78659bd80e45ddb44b3cafb4937aa7b4e5f1b14
Author: Jelte Jansen <jelte at isc.org>
Date:   Fri Feb 18 12:02:44 2011 +0100

    [trac384] improve tab-completion suggestions

-----------------------------------------------------------------------

Summary of changes:
 src/bin/bindctl/bindcmd.py |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/bin/bindctl/bindcmd.py b/src/bin/bindctl/bindcmd.py
index 6ee9068..00bb69f 100644
--- a/src/bin/bindctl/bindcmd.py
+++ b/src/bin/bindctl/bindcmd.py
@@ -437,7 +437,19 @@ class BindCmdInterpreter(Cmd):
         Cmd.onecmd(self, line)
 
     def remove_prefix(self, list, prefix):
-        return [(val[len(prefix):]) for val in list]
+        """Removes the prefix already entered, and all elements from the
+           list that don't match it"""
+        if prefix.startswith('/'):
+            prefix = prefix[1:]
+
+        new_list = []
+        for val in list:
+            if val.startswith(prefix):
+                new_val = val[len(prefix):]
+                if new_val.startswith("/"):
+                    new_val = new_val[1:]
+                new_list.append(new_val)
+        return new_list
 
     def complete(self, text, state):
         if 0 == state:




More information about the bind10-changes mailing list