Repository: ManimCommunity/manim
File: manim/cli/render/commands.py (Python)

Code before:
        logger.warning(
            "--use_opengl_renderer is deprecated, please use --renderer=opengl instead!"
        )
        args["renderer"] = "opengl"

    if args["use_webgl_renderer"]:
        logger.warning(
            "--use_webgl_renderer is deprecated, please use --renderer=webgl instead!"
        )
        args["renderer"] = "webgl"

    if args["use_webgl_renderer"] and args["use_opengl_renderer"]:
        logger.warning("You may select only one renderer!")
        sys.exit()

    if args["save_as_gif"]:
        logger.warning("--save_as_gif is deprecated, please use --format=gif instead!")
        args["format"] = "gif"

    if args["save_pngs"]:
        logger.warning("--save_pngs is deprecated, please use --format=pngs instead!")
        args["format"] = "pngs"

    if args["save_last_frame"]:
        logger.warning(
            "--save_last_frame is deprecated, please use --format=png instead!"
        )
        args["format"] = "png"

    class ClickArgs:
        def __init__(self, args):
            for name in args:
                setattr(self, name, args[name])

        def _get_kwargs(self):
            return list(self.__dict__.items())

        def __eq__(self, other):
            if not isinstance(other, ClickArgs):
                return NotImplemented
            return vars(self) == vars(other)

        def __contains__(self, key):
            return key in self.__dict__

        def __repr__(self):
            return str(self.__dict__)

    click_args = ClickArgs(args)
    if args["jupyter"]:
        return click_args

Review comment (suggestion):
`png` vs `pngs` is sort of confusing. What I would suggest is keeping `save_last_frame` for saving the last frame and `--format=png` would go for saving all the frames as png. If both `--format=png` and `save_last_frame` is passed it would be better to just prefer `save_last_frame` and warn about  `--format=png`.

Code after:
        logger.warning(
            "--use_opengl_renderer is deprecated, please use --renderer=opengl instead!"
        )
        args["renderer"] = "opengl"

    if args["use_webgl_renderer"]:
        logger.warning(
            "--use_webgl_renderer is deprecated, please use --renderer=webgl instead!"
        )
        args["renderer"] = "webgl"

    if args["use_webgl_renderer"] and args["use_opengl_renderer"]:
        logger.warning("You may select only one renderer!")
        sys.exit()

    if args["save_as_gif"]:
        logger.warning("--save_as_gif is deprecated, please use --format=gif instead!")
        args["format"] = "gif"

    if args["save_pngs"]:
        logger.warning("--save_pngs is deprecated, please use --format=png instead!")
        args["format"] = "png"

    if args["show_in_file_browser"]:
        logger.warning(
            "The short form of show_in_file_browser is deprecated and will be moved to support --format."
        )

    class ClickArgs:
        def __init__(self, args):
            for name in args:
                setattr(self, name, args[name])

        def _get_kwargs(self):
            return list(self.__dict__.items())

        def __eq__(self, other):
            if not isinstance(other, ClickArgs):
                return NotImplemented
            return vars(self) == vars(other)

        def __contains__(self, key):
            return key in self.__dict__

        def __repr__(self):
            return str(self.__dict__)

    click_args = ClickArgs(args)
    if args["jupyter"]:
        return click_args