about summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-10-14 13:21:49 -0500
committerFrederick Muriuki Muriithi2024-10-14 13:27:43 -0500
commit6810643b159d295eeb298ce6980775d894c660f5 (patch)
tree4f3f145d80a3946ee76df2b1b2e719753527ed25 /scripts
parent57fa9c35d25a7ca5e8d7e3fc021f12cecef06a60 (diff)
downloadgn-uploader-6810643b159d295eeb298ce6980775d894c660f5.tar.gz
Make addition of arguments independent of each other.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/rqtl2/cli_parser.py20
1 files changed, 15 insertions, 5 deletions
diff --git a/scripts/rqtl2/cli_parser.py b/scripts/rqtl2/cli_parser.py
index bcc7a4f..9bb60a3 100644
--- a/scripts/rqtl2/cli_parser.py
+++ b/scripts/rqtl2/cli_parser.py
@@ -2,12 +2,22 @@
 from pathlib import Path
 from argparse import ArgumentParser
 
-def add_common_arguments(parser: ArgumentParser) -> ArgumentParser:
-    """Add common arguments to the CLI parser."""
-    parser.add_argument("datasetid",
-                        type=int,
-                        help="The dataset to which the data belongs.")
+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))