Mercurial > python-cmd2
diff docs/unfreefeatures.rst @ 332:49bea7cab179
doc refreshing refresh.bash
author | cat@eee |
---|---|
date | Fri, 12 Feb 2010 22:15:04 -0500 |
parents | 6306edc46a6e |
children | 45e70737791f |
line wrap: on
line diff
--- a/docs/unfreefeatures.rst Fri Feb 12 21:41:17 2010 -0500 +++ b/docs/unfreefeatures.rst Fri Feb 12 22:15:04 2010 -0500 @@ -189,3 +189,26 @@ to read. ``quiet`` is only relevant if ``app.pfeedback`` is sometimes used. +``select`` +========== + +``app.select`` is called from within a method (not by the user directly; it is ``app.select``, not ``app.do_select``). + +.. automethod:: cmd2.Cmd.select + +:: + + def do_eat(self, arg): + sauce = self.select('sweet salty', 'Sauce? ') + result = '{food} with {sauce} sauce, yum!' + result = result.format(food=arg, sauce=sauce) + self.stdout.write(result + '\n') + +:: + + (Cmd) eat wheaties + 1. sweet + 2. salty + Sauce? 2 + wheaties with salty sauce, yum! +