verbose = False short = False for opt, arg in opts: if opt in ("-h", "--help"): print(""" useage: -h --help : print help -v --verbose : show dmesg oom kill log -c --critical_num : How many times is called a critical -w --warning_num : How many times is called a warning """) sys.exit() elif opt in ("-c", "--critical_num"): critical_num = arg elif opt in ("-w", "--warning_num"): warning_num = arg elif opt in ("-s"): short = True elif opt in ("-v"): verbose = True