diff example/example.py @ 309:1941e54cb776

added bash-style SELECT
author catherine@dellzilla
date Fri, 29 Jan 2010 10:32:40 -0500
parents 30af90fd46c5
children 9d91406ca3a7
line wrap: on
line diff
--- a/example/example.py	Thu Jan 28 08:52:04 2010 -0500
+++ b/example/example.py	Fri Jan 29 10:32:40 2010 -0500
@@ -26,6 +26,10 @@
             self.stdout.write('\n')
             # self.stdout.write is better than "print", because Cmd can be
             # initialized with a non-standard output destination
+    def do_sel(self, arg):
+        opts = arg.split()
+        result = self.select(opts)
+        self.poutput('yay for %s' % result)
 
     do_say = do_speak     # now "say" is a synonym for "speak"
     do_orate = do_speak   # another synonym, but this one takes multi-line input