Skip to content

Commit dd05cd8

Browse files
committed
Support additional tinyrox::document arguments in trox
1 parent e157975 commit dd05cd8

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2026-06-06 Dirk Eddelbuettel <edd@debian.org>
2+
3+
* inst/examples/trox.r: Support additional arguments
4+
15
2026-04-15 Dirk Eddelbuettel <edd@debian.org>
26

37
* inst/examples/trox.r: Officially added as tinyrox is now on CRAN

inst/examples/trox.r

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@
1010
library(docopt)
1111

1212
## configuration for docopt
13-
doc <- "Usage: trox.r [-h] [-x] [PACKAGES ...]
13+
doc <- "Usage: trox.r [-n none] [-c] [-v] [-h] [-x] [PACKAGES ...]
1414
15+
-n --namespace none namespace argument, one of 'overwrite', 'append', 'none' [default: none]
16+
-c --crancheck should the CRAN compliance check run [default: FALSE]
17+
-v --verbose should the operation be verbose rather than silent [default: FALSE]
1518
-h --help show this help text
1619
-x --usage show help and short example usage"
1720
opt <- docopt(doc) # docopt parsing
@@ -29,6 +32,9 @@ information.\n")
2932
q("no")
3033
}
3134

35+
if (!opt$namespace %in% c("overwrite", "append", "none"))
36+
stop(r"[The 'namespace' argument must be one of "overwrite", "append", "none".]", call. = FALSE)
37+
3238
## load tinyrox
3339
library(tinyrox)
3440

@@ -37,4 +43,8 @@ argv <- Filter(function(x) file.info(x)$is.dir, argv)
3743

3844
## loop over all argument, with fallback of the current directory, and
3945
## call document() on the given directory
40-
sapply(ifelse(length(argv) > 0, argv, "."), FUN = document)
46+
sapply(ifelse(length(argv) > 0, argv, "."),
47+
FUN = document,
48+
namespace = opt$namespace,
49+
cran_check = opt$crancheck,
50+
silent = !opt$verbose)

0 commit comments

Comments
 (0)