Sun, 28 Oct 2012 10:53:19 +0100
changed --slot parameter to 1..6 instead of 0..5
slotUI/SlotCli.py | file | annotate | diff | comparison | revisions |
--- 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))