changeset 291:dfdbd93a2fae

bugfixes to set
author catherine@bothari
date Fri, 06 Nov 2009 22:09:57 -0500
parents cd12e4e0fa17
children 23cf05c6276c
files cmd2.py example/example.py
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/cmd2.py	Fri Nov 06 21:41:55 2009 -0500
+++ b/cmd2.py	Fri Nov 06 22:09:57 2009 -0500
@@ -854,10 +854,10 @@
         as there is no ambiguity.  Call without arguments for a list of 
         settable parameters with their values.'''
         try:
-            paramName, val = arg.split(None, 1)
+            statement, paramName, val = arg.parsed.raw.split(None, 2)
             paramName = paramName.strip().lower()
             if paramName not in self.settable:
-                hits = [p for p in self.settable if p.startswith(p)]
+                hits = [p for p in self.settable if p.startswith(paramName)]
                 if len(hits) == 1:
                     paramName = hits[0]
                 else:
--- a/example/example.py	Fri Nov 06 21:41:55 2009 -0500
+++ b/example/example.py	Fri Nov 06 22:09:57 2009 -0500
@@ -7,7 +7,7 @@
     multilineCommands = ['orate']
     Cmd.shortcuts.update({'&': 'speak'})
     maxrepeats = 3
-    Cmd.settable.append('maxrepeats   Max number of `--repeat` allowed')
+    Cmd.settable.append('maxrepeats   Max number of `--repeat`s allowed')
 
     @options([make_option('-p', '--piglatin', action="store_true", help="atinLay"),
               make_option('-s', '--shout', action="store_true", help="N00B EMULATION MODE"),