Skip to content

Commit b1bce78

Browse files
author
Richard Jones
committed
Expanded the already-abbreviated "initialise" and "specification" commands...
...and added a comment to the command help about the abbreviation.
1 parent 1d2483b commit b1bce78

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

roundup-admin

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1717
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1818
#
19-
# $Id: roundup-admin,v 1.39 2001-11-08 04:29:59 richard Exp $
19+
# $Id: roundup-admin,v 1.40 2001-11-08 04:42:00 richard Exp $
2020

2121
import sys
2222
if int(sys.version[0]) < 2:
@@ -38,8 +38,8 @@ class CommandDict(UserDict.UserDict):
3838
'''
3939
_marker = []
4040
def get(self, key, default=_marker):
41-
d = self.data.get(key, default)
42-
if d is not default: return [(key, d)]
41+
if self.data.has_key(key):
42+
return [(key, self.data[key])]
4343
keylist = self.data.keys()
4444
keylist.sort()
4545
l = []
@@ -82,9 +82,13 @@ Options:
8282
commands = ['']
8383
for command in self.commands.values():
8484
h = command.__doc__.split('\n')[0]
85-
commands.append(h[7:])
85+
commands.append(' '+h[7:])
8686
commands.sort()
87-
print '\n '.join(commands)
87+
commands.append(
88+
'Commands may be abbreviated as long as the abbreviation matches only one')
89+
commands.append('command, e.g. l == li == lis == list.')
90+
print '\n'.join(commands)
91+
print
8892

8993
def help_all(self):
9094
print '''
@@ -185,8 +189,8 @@ Command help:
185189
print 'Back ends:', ', '.join(backends)
186190

187191

188-
def do_init(self, instance_home, args):
189-
'''Usage: init [template [backend [admin password]]]
192+
def do_initialise(self, instance_home, args):
193+
'''Usage: initialise [template [backend [admin password]]]
190194
Initialise a new Roundup instance.
191195
192196
The command will prompt for the instance home directory (if not supplied
@@ -319,8 +323,8 @@ Command help:
319323
print cl.find(**{propname: value})
320324
return 0
321325

322-
def do_spec(self, args):
323-
'''Usage: spec classname
326+
def do_specification(self, args):
327+
'''Usage: specification classname
324328
Show the properties for a classname.
325329
326330
This lists the properties for a given class.
@@ -721,6 +725,10 @@ if __name__ == '__main__':
721725

722726
#
723727
# $Log: not supported by cvs2svn $
728+
# Revision 1.39 2001/11/08 04:29:59 richard
729+
# roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
730+
# [thanks Engelbert Gruber for the inspiration]
731+
#
724732
# Revision 1.38 2001/11/05 23:45:40 richard
725733
# Fixed newuser_action so it sets the cookie with the unencrypted password.
726734
# Also made it present nicer error messages (not tracebacks).

0 commit comments

Comments
 (0)