slotUI/SlotCli.py

changeset 101
92d204c738e1
parent 100
039ab094f79b
child 102
72f5eb420096
--- a/slotUI/SlotCli.py	Sun Oct 28 10:41:39 2012 +0100
+++ b/slotUI/SlotCli.py	Sun Oct 28 10:53:19 2012 +0100
@@ -447,7 +447,7 @@
         help="Run Live monitor on console", metavar="[0-5]")
 
     parser.add_option("--slot", dest="carid",
-        help="Required for programming a car directly", metavar="[0-5]")
+        help="Required for programming a car directly", metavar="[1-6]")
     parser.add_option("--fuel", dest="fuel",
         help="Set maximum CAR fuel level", metavar="[0-15]")
     parser.add_option("--brake", dest="brake",
@@ -474,8 +474,13 @@
 
     # check commandline if we have to program something
     if not options.carid:
-        print "Option --carid is required for all car programming commands!\nUse --help to get a list of available commands"
+        print "Option --slot is required for all car programming commands!\nUse --help to get a list of available commands"
         sys.exit(1)
+    else:
+        options.carid = int(options.carid) - 1
+        if (options.carid < 0) or (options.carid > 6):
+            print "Error: Invalid slot selected"
+            sys.exit(1)
 
     if options.fuel:
         print "setFuel: " + cli.box.progcar(int(options.carid), "fuel", int(options.fuel))

mercurial