aboutsummaryrefslogtreecommitdiff
"""Utilities for CLI parsers specific to R/qtl2 parsing scripts."""
from pathlib import Path
from argparse import ArgumentParser

def add_bundle_argument(parser: ArgumentParser) -> ArgumentParser:
    """Add the `rqtl2bundle` argument."""
    parser.add_argument("rqtl2bundle",
                        type=Path,
                        help="Path to R/qtl2 bundle zip file.")
    return parser


def add_datasetid_argument(parser: ArgumentParser) -> ArgumentParser:
    """Add the `datasetid` argument."""
    parser.add_argument("datasetid",
                        type=int,
                        help="The dataset to which the data belongs.")
    return parser


def add_common_arguments(parser: ArgumentParser) -> ArgumentParser:
    """Add common arguments to the CLI parser."""
    return add_bundle_argument(add_datasetid_argument(parser))