def help(): """ help -- this message """ print "Small script to help compiling and running OpenEngine." print "Some useful targets are:" printCommands(commands())
def usage(): """ help -- this message """ print "Small script to help working on OpenEngine repositories." print "Some useful targets are:" printCommands(commands())
def main(): # check run location if not path.isfile(path.join(os.getcwd(), "dist.py")): print "You must run dist.py from the OpenEngine root directory." # if no command is given run default if len(sys.argv) < 2: update() sys.exit(0) # get command cmd = sys.argv[1] fn = None for f,c in commands(): if cmd == c: fn = f try: fn(*sys.argv[2:]) except TypeError: print "Invalid command." print "Possible commands are:" printCommands(commands()) sys.exit(1)
def main(): # check run location if not path.isfile(path.join(os.getcwd(), "make.py")): print "You must run make.py from the OpenEngine root directory." # if no command is given run default if len(sys.argv) < 2: build() sys.exit(0) # get command cmd = sys.argv[1] fn = None for f,c in commands(): if cmd == c: fn = f if fn: fn() elif len(sys.argv) == 2: make(sys.argv[1]) else: print "Invalid command." print "Possible commands are:" printCommands(commands()) sys.exit(1)