From 4b7e72526f5ff47013f97f8eb0edbffd73a11c98 Mon Sep 17 00:00:00 2001 From: A git user Date: Fri, 7 Oct 2022 17:17:47 +0200 Subject: [PATCH 1/3] Ignore binary package folders under /R/ from building using install_local --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 5d2918f..dc4d50a 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ inst/doc optigrab.Rcheck/ optigrab_*.gz - +# binary packages from building using install_local() +R/*/ From 1c5d53d0cd2f7d14672e031323bf8038f7c9e09e Mon Sep 17 00:00:00 2001 From: A git user Date: Fri, 7 Oct 2022 17:18:25 +0200 Subject: [PATCH 2/3] Fix quitting after showing help in noninteractive sessions. This fixes this error: Error in quit(save = FALSE) : one of "yes", "no", "ask" or "default" expected. Calls: opt_help -> quit Execution halted --- R/opt_help.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/opt_help.R b/R/opt_help.R index 49c00b4..01b5501 100644 --- a/R/opt_help.R +++ b/R/opt_help.R @@ -62,7 +62,7 @@ opt_help <- function( name=c('help','?'), opts=commandArgs() ) { for( nm in names(opts) ) cat( paste(' ', nm, ":", opts[[nm]], sep=" "), sep="\n" ) - if( ! interactive() ) quit( save = FALSE ) + if( ! interactive() ) quit( save = "no" ) return(TRUE) From 141c8028ac861795ad755c13619ffdca2dd96830 Mon Sep 17 00:00:00 2001 From: A git user Date: Fri, 7 Oct 2022 17:29:54 +0200 Subject: [PATCH 3/3] Fix output of missing options with multiple flags. The output was: Option(s): [-p--project] is required, but was not supplied. and now is: Option(s): [-p, --project] is required, but was not supplied. which makes it more readable and conforms better with established standards --- R/opt_get.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/opt_get.R b/R/opt_get.R index f44a31f..49ab812 100644 --- a/R/opt_get.R +++ b/R/opt_get.R @@ -144,7 +144,7 @@ opt_get <- function( ret <- opt_grab( flag=flag, n=n, opts=opts) - # Apply defaults, including trying to coerce to the defailts + # Apply defaults, including trying to coerce to the defaults # class if( ! missing(default) ) { if( is.na(ret) ) @@ -157,7 +157,7 @@ opt_get <- function( if( is.na(ret) && missing(default) && required == TRUE ) stop( call. = FALSE - , "\n\tOption(s): [", flag, "] is required, but was not supplied." + , "\n\tOption(s): [", paste(flag, collapse=", "), "] is required, but was not supplied." )