aboutsummaryrefslogtreecommitdiff
path: root/scripts/rqtl2/cli_parser.py
blob: 9bb60a3c9446945d2a7e2b830714849ec52b5ad8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"""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))