def parse_package_arg(name, arg):
    """Make a command-line argument string specifing whether and which verison of a package to install.

    Args:
        name: The name of the package.
        arg: True if the package is required, False if the package is not required,
            or a string containing a version number if a specific version of the package
            is required.

    Returns:
        A string which can be used as an argument to the virtualenv command.
    """
    if arg == True:
        option = ""
    elif arg == False:
        option = f"--no-{name}"
    else:
        option = f"--{name}={arg}"
    return option