[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[minion-cvs] Improve usage and error messages



Update of /home/minion/cvsroot/src/minion/lib/mixminion/directory
In directory moria.mit.edu:/tmp/cvs-serv14596/lib/mixminion/directory

Modified Files:
	DirMain.py 
Log Message:
Improve usage and error messages

Index: DirMain.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/directory/DirMain.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- DirMain.py	5 Jan 2003 13:19:53 -0000	1.6
+++ DirMain.py	6 Jan 2003 03:29:46 -0000	1.7
@@ -19,7 +19,8 @@
      pk_PEM_load, pk_PEM_save
 from mixminion.directory.ServerList import ServerList
 
-USAGE = """%s -d <directory> command
+USAGE = """\
+Usage: %s -d <directory> command
    Where 'command' is one of:
       import <serverinfo>      [Import a descriptor for a known server]
       import-new <serverinfo>  [Import a descriptor for a new server]
@@ -27,7 +28,7 @@
       export <filename>        [Export the most recently generated directory]
       remove <nickname>        [Remove a server from storage]
       fingerprint              [Return the fingerprint of this directory's pk]
-"""
+""".strip()
 
 def getIdentity(baseDir):
     """Load the identity key stored under the base directory, creating it
@@ -113,7 +114,7 @@
                 'fingerprint' : cmd_fingerprint }
 
 def main(cmd, args):
-    if len(args) < 3 or args[0] != "-d":
+    if len(args) < 3 or args[0] != "-d" or args[0] in ('-h', '--help'):
         usageAndExit(cmd)
     baseDir = args[1]
     command = args[2]