def get_flag(cls):
if cls.short_flag is None:
assert cls.flag, "No flag specified for {}!\n".format(cls.__name__)
return cls.flag[:1], cls.flag
else:
return cls.short_flag, cls.flag
@classmethod
After Change
def get_flag(cls):
// Get the flag name from the class name
flag = cls.__name__
if flag.endswith("Option"):
flag = flag[:-6]
flag = convert_camel_case_to_snake_case(flag)
if cls.short_flag is None:
return flag[:1], flag