diff roundup-admin @ 372:3b9410cb8b61

Expanded the already-abbreviated "initialise" and "specification" commands... ...and added a comment to the command help about the abbreviation.
author Richard Jones <richard@users.sourceforge.net>
date Thu, 08 Nov 2001 04:42:00 +0000
parents f348aa576d51
children c6d6ea15068b
line wrap: on
line diff
--- a/roundup-admin	Thu Nov 08 04:29:59 2001 +0000
+++ b/roundup-admin	Thu Nov 08 04:42:00 2001 +0000
@@ -16,7 +16,7 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 # 
-# $Id: roundup-admin,v 1.39 2001-11-08 04:29:59 richard Exp $
+# $Id: roundup-admin,v 1.40 2001-11-08 04:42:00 richard Exp $
 
 import sys
 if int(sys.version[0]) < 2:
@@ -38,8 +38,8 @@
     '''
     _marker = []
     def get(self, key, default=_marker):
-        d = self.data.get(key, default)
-        if d is not default: return [(key, d)]
+        if self.data.has_key(key):
+            return [(key, self.data[key])]
         keylist = self.data.keys()
         keylist.sort()
         l = []
@@ -82,9 +82,13 @@
         commands = ['']
         for command in self.commands.values():
             h = command.__doc__.split('\n')[0]
-            commands.append(h[7:])
+            commands.append(' '+h[7:])
         commands.sort()
-        print '\n '.join(commands)
+        commands.append(
+'Commands may be abbreviated as long as the abbreviation matches only one')
+        commands.append('command, e.g. l == li == lis == list.')
+        print '\n'.join(commands)
+        print 
 
     def help_all(self):
         print '''
@@ -185,8 +189,8 @@
         print 'Back ends:', ', '.join(backends)
 
 
-    def do_init(self, instance_home, args):
-        '''Usage: init [template [backend [admin password]]]
+    def do_initialise(self, instance_home, args):
+        '''Usage: initialise [template [backend [admin password]]]
         Initialise a new Roundup instance.
 
         The command will prompt for the instance home directory (if not supplied
@@ -319,8 +323,8 @@
             print cl.find(**{propname: value})
         return 0
 
-    def do_spec(self, args):
-        '''Usage: spec classname
+    def do_specification(self, args):
+        '''Usage: specification classname
         Show the properties for a classname.
 
         This lists the properties for a given class.
@@ -721,6 +725,10 @@
 
 #
 # $Log: not supported by cvs2svn $
+# Revision 1.39  2001/11/08 04:29:59  richard
+# roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
+# [thanks Engelbert Gruber for the inspiration]
+#
 # Revision 1.38  2001/11/05 23:45:40  richard
 # Fixed newuser_action so it sets the cookie with the unencrypted password.
 # Also made it present nicer error messages (not tracebacks).

Roundup Issue Tracker: http://roundup-tracker.org/