Skip to contents

Validates and normalises arguments from the parsed argparse result, then calls cli_nemo_tidy(). When wf is non-NULL it overrides args$workflow (used by downstream packages that fix the workflow at the script level, e.g. tidywigits.R).

Usage

cli_tidy_parse_args(args, wf = NULL, dbdrv = NULL)

Arguments

args

Named list of parsed CLI arguments, as returned by argparse. Expected fields: format, in_dir, output_dir, input_id (optional), output_id (optional), ulid, prefix_include, dbname, dbuser, include, exclude, workflow (may be NULL when wf is provided), quiet. output_id and ulid are mutually exclusive at the CLI level (enforced by argparse). When called directly, if both are set ulid takes precedence and output_id is silently ignored.

wf

(character(1) or NULL)
Workflow override. When non-NULL, replaces args$workflow.

dbdrv

(DBIDriver or NULL)
DBI driver object (e.g. RPostgres::Postgres()). Required when args$format is "db"; ignored otherwise. Supplied by the caller so that nemo does not depend on any specific database backend.

Examples

path <- system.file("extdata/tool1", package = "nemo")
args <- list(
  format = "tsv", in_dir = path, output_dir = tempfile(),
  input_id = "run1", output_id = NULL, ulid = FALSE,
  prefix_include = FALSE, workflow = NULL, dbname = NULL, dbuser = NULL,
  include = NULL, exclude = NULL, quiet = FALSE
)
cli_tidy_parse_args(args, wf = "workflow1")
#> [2026-07-28T09:32:42UTC] nemo INFO: Tidying dir: /home/runner/miniconda3/envs/pkgdown_env/lib/R/library/nemo/extdata/tool1
#> [2026-07-28T09:32:43UTC] nemo INFO: Tidy results written to dir: /tmp/RtmpLFaYvY/file1152741dbd2c