(cli_parser, mouse_profile)
Adds the CLI options for the given mouse profile.

    :param ArgumentParser cli_parser: An :class:`ArgumentParser` instance.
    :param mouse_profile: One of the rivalcfg mouse profile (provided by
                            :func:`rivalcfg.devices.get_profile`).
Adds the CLI options for the given mouse profile.
Adds the CLI options for the given mouse profile .
def add_mouse_cli(cli_parser, mouse_profile):
    """Adds the CLI options for the given mouse profile.

    :param ArgumentParser cli_parser: An :class:`ArgumentParser` instance.
    :param mouse_profile: One of the rivalcfg mouse profile (provided by
                            :func:`rivalcfg.devices.get_profile`).
    """
    cli_group = cli_parser.add_argument_group("%s Options" % mouse_profile["name"])

    for setting_name, setting_info in mouse_profile["settings"].items():
        handler = getattr(handlers, setting_info["value_type"])
        handler.add_cli_option(cli_group, setting_name, setting_info)

    cli_group.add_argument(
        "-r",
        "--reset",
        help="Reset all settings to their factory default",
        dest="RESET",
        action="store_true",
    )

    if "firmware_version" in mouse_profile:
        cli_group.add_argument(
            "--firmware-version",
            help="Print the firmware version of the mouse and exit",
            dest="FIRMWARE_VERSION",
            action="store_true",
        )

    if "battery_level" in mouse_profile:
        cli_group.add_argument(
            "--battery-level",
            help="Print the battery level of the mouse and exit",
            dest="BATTERY_LEVEL",
            action="store_true",
        )
def add_mouse_cli ( cli_parser , mouse_profile ) : cli_group = cli_parser . add_argument_group ( "%s Options" % mouse_profile [ "name" ] ) for setting_name , setting_info in mouse_profile [ "settings" ] . items ( ) : handler = getattr ( handlers , setting_info [ "value_type" ] ) handler . add_cli_option ( cli_group , setting_name , setting_info ) cli_group . add_argument ( "-r" , "--reset" , help = "Reset all settings to their factory default" , dest = "RESET" , action = "store_true" , ) if "firmware_version" in mouse_profile : cli_group . add_argument ( "--firmware-version" , help = "Print the firmware version of the mouse and exit" , dest = "FIRMWARE_VERSION" , action = "store_true" , ) if "battery_level" in mouse_profile : cli_group . add_argument ( "--battery-level" , help = "Print the battery level of the mouse and exit" , dest = "BATTERY_LEVEL" , action = "store_true" , )