# A package that contains functions to configure arguments

import argparse


def add_recepie_argument(argument_parser: argparse.ArgumentParser):
    argument_parser.add_argument(
        "recepie",
        help="Path to the folder containing the recepie to build",
    )


def add_version_argument(argument_parser: argparse.ArgumentParser):
    argument_parser.add_argument(
        "version",
        help="Specify version of the package",
    )


def add_build_option(argument_parser: argparse.ArgumentParser):
    argument_parser.add_argument(
        "--build",
        action="store_true",
        help="Build the conan package and store it in local cache (enabled by default)",
    )
    argument_parser.add_argument(
        "--no-build",
        dest="build",
        action="store_false",
        help="Disable the build of the conan package",
    )
    argument_parser.set_defaults(build=True)


def add_clear_option(argument_parser: argparse.ArgumentParser):
    argument_parser.add_argument(
        "--clear",
        action="store_true",
        help="Clear the conan build cache before build (enabled by default)",
    )
    argument_parser.add_argument(
        "--no-clear",
        dest="clear",
        action="store_false",
        help="Do not clear the conan build cache",
    )
    argument_parser.set_defaults(clear=True)


def add_publish_option(argument_parser: argparse.ArgumentParser):
    argument_parser.add_argument(
        "--publish",
        action="store_true",
        help="Publish package in Aurora conan repository",
    )
    argument_parser.add_argument(
        "--no-publish",
        dest="publish",
        action="store_false",
        help="Do not publish the build package in remote repository (by default)",
    )
    argument_parser.set_defaults(publish=False)


def add_target_option(argument_parser: argparse.ArgumentParser):
    argument_parser.add_argument(
        "--target",
        nargs="+",
        default=(),
        help="List of targets that should be used. Match is made by a substring",
    )


def add_login_argument(argument_parser: argparse.ArgumentParser):
    argument_parser.add_argument(
        "user",
        help="Name of the user to login with",
    )


def add_password_argument(argument_parser: argparse.ArgumentParser):
    argument_parser.add_argument(
        "password",
        help="Password of the user to login with",
    )
