[CalendarServer-changes] [8453] CalendarServer/trunk/calendarserver/tools/shell.py

source_changes at macosforge.org source_changes at macosforge.org
Wed Dec 14 18:29:50 PST 2011


Revision: 8453
          http://trac.macosforge.org/projects/calendarserver/changeset/8453
Author:   wsanchez at apple.com
Date:     2011-12-14 18:29:50 -0800 (Wed, 14 Dec 2011)
Log Message:
-----------
Basic tab completion works for command names.

Modified Paths:
--------------
    CalendarServer/trunk/calendarserver/tools/shell.py

Modified: CalendarServer/trunk/calendarserver/tools/shell.py
===================================================================
--- CalendarServer/trunk/calendarserver/tools/shell.py	2011-12-15 02:07:24 UTC (rev 8452)
+++ CalendarServer/trunk/calendarserver/tools/shell.py	2011-12-15 02:29:50 UTC (rev 8453)
@@ -230,9 +230,16 @@
             completions = set()
             for name, m in self.commands():
                 if name.startswith(cmd):
-                    completions.add(name)
+                    completions.add(name[len(cmd):])
 
-        log.msg("TAB: %r :: %r" % ("".join(self.lineBuffer), completions))
+        if len(completions) == 1:
+            for word in completions:
+                break
+            for c in word:
+                self.characterReceived(c, True)
+            self.characterReceived(" ", False)
+        else:
+            log.msg("TAB: %r :: %r" % ("".join(self.lineBuffer), completions))
 
     def exit(self):
         self.terminal.loseConnection()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20111214/e7362023/attachment-0001.html>


More information about the calendarserver-changes mailing list