print("alias uppercase='python cmd.py uppercase';")
if __name__ == '__main__':
    cmd = sys.argv[1]
if cmd == '--eval':
    do_eval()
else:
    args = sys.argv[2:]
if cmd == 'repeat':
    do_repeat(*args)
elif cmd == 'uppercase':
    do_uppercase(args)
else:
    print('Unknown command: ' + cmd)
Running a python function as a bash command