# HG changeset patch # User Malte Bayer # Date 1351417999 -3600 # Node ID 92d204c738e132d6b1780c17f35871aa1b2f03af # Parent 039ab094f79ba4ffcef5c801987a599c075ad736 changed --slot parameter to 1..6 instead of 0..5 diff -r 039ab094f79b -r 92d204c738e1 slotUI/SlotCli.py --- 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))