]> scripts.mit.edu Git - wizard.git/blobdiff - bin/wizard
Fix 'wizard' to print help.
[wizard.git] / bin / wizard
index f93266fb4b389b7b104ffd9d1d0f336af26b683c..958226644238013d2307ca4785b468b2bc43bcd0 100755 (executable)
@@ -5,7 +5,7 @@ import optparse
 import sys
 
 # Add lib to path
-sys.path.insert(0,os.path.abspath(os.path.join(__file__,'../..')))
+sys.path.insert(0,os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 import wizard.command
 
 def main():
@@ -18,6 +18,7 @@ Its commands are:
     massmigrate     Performs mass migration of autoinstalls of an application
     migrate         Migrate autoinstalls from old format to Git-based format
     summary         Generate statistics about autoinstalls
+    upgrade         Upgrades an autoinstall to the latest version
 
 See '%prog help COMMAND' for more information on a specific command."""
 
@@ -29,7 +30,11 @@ See '%prog help COMMAND' for more information on a specific command."""
     # Find the end of the "global" options
     options, args = parser.parse_args()
     rest_argv = args[1:]
-    command = args[0] # shouldn't fail
+    try:
+        command = args[0]
+    except IndexError:
+        parser.print_help()
+        raise SystemExit(-1)
     if command == "help":
         try:
             getattr(wizard.command, rest_argv[0]).main(['-h'], options)