[Roxygen-devel] roxygen script

Peter Danenberg pcd at roxygen.org
Wed Aug 4 18:28:32 CEST 2010


Thanks, Bart; Manuel and I were trying to come up with a general
mechanism for modifying the behavior of roxygenize by e.g. specifying
options, adding roclets, etc.

use.Rd2=TRUE could be specified by a more general mechanism; or do you
think it warrants its own option?

> Hi,
> 
> I added the "-s" option to the roxygen script in pkg/src/ . A svn diff to revision 249 is given below.
> If the option is set then use.Rd2=TRUE will be used in the call to roxygenize.
> 
> So for example:
> 	R CMD roxygen -d -s basedir
> now works and enables Rd2 instead of Rd.
> 
> I chose the letter 's' because use.Rd2 effectively means it is able to parse S4 classes.
> 
> Regards,
> Bart Janssen
> 
> Index: roxygen
> ===================================================================
> --- roxygen	(revision 249)
> +++ roxygen	(working copy)
> @@ -19,13 +19,14 @@
>  Options:
>    -d  (Destructive) operate in place on SOURCE
>    -u       (Unlink) clean TARGET first
> +  -s  (Rd2) enable parsing of S4 tags
>  
>    -h         (Help) print short help message and exit
>    -v      (Version) print roxygen version info and exit
>  
>  Report bugs to <roxygen-devel at lists.r-forge.r-project.org>."
>  
> -while getopts duhv OPT; do
> +while getopts dushv OPT; do
>      case $OPT in
>          d|+d)
>              destructive="TRUE"
> @@ -33,6 +34,9 @@
>          u|+u)
>              unlink="TRUE"
>              ;;
> +        s|+s)
> +            rd2="TRUE"
> +            ;;
>          h|+h)
>              echo ${usage}
>              exit 0
> @@ -95,15 +99,18 @@
>  
>  : ${unlink:="FALSE"}
>  : ${copy:="TRUE"}
> +: ${rd2:="FALSE"}
>  
>  debug () {
> -    echo source: "${source}"\; target: "${target}"\; copy: "${copy}"\; unlink: "${unlink}"
> +    echo source: "${source}"\; target: "${target}"\; copy: "${copy}"\; unlink: "${unlink}"\; rd2: "${rd2}"
>  }
>  
> +
>  R_EXE="${R_HOME}/bin/R"
>  echo "library(roxygen)
>        roxygenize(package.dir=${source},
>                   roxygen.dir=${target},
>                   copy.package=${copy},
> -                 unlink.target=${unlink})" | \
> +                 unlink.target=${unlink},
> +                 use.Rd2=${rd2})" | \
>      "${R_EXE}" --no-restore --slave
> 
> 
> 
> _______________________________________________
> Roxygen-devel mailing list
> Roxygen-devel at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/roxygen-devel
> 


More information about the Roxygen-devel mailing list