#! /usr/bin/python import getopt, sys HELP_TEXT = """\ pythontemplate [-h] A program doing nothing. -h Show this text and exit.""" def main(): options, arguments = getopt.gnu_getopt(sys.argv[1:], "h") for name, value in options: if name == "-h": print(HELP_TEXT) sys.exit(0) if __name__ == "__main__": main()