1010library(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"
1720opt <- 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
3339library(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