def METHOD_NAME(cfg: dataclasses.dataclass) -> List[str]:
    def rewrite_option(opt: str) -> str:
        new_opt = opt.replace("_", "-")
        return f"--{new_opt}"
    out = []
    for fld in dataclasses.fields(cfg):
        new_option = rewrite_option(fld.name)
        val = getattr(cfg, fld.name)
        if isinstance(val, bool):
            if val:
                out.append(new_option)
        else:
            out.append(new_option)
            out.append(str(getattr(cfg, fld.name)))
    return out