Skip to content

Commit

Permalink
chore: CRAN release
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorld committed Sep 16, 2019
1 parent 66acec5 commit c129526
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Encoding: UTF-8
Package: optparse
Type: Package
Title: Command Line Option Parser
Version: 1.6.3-1
Version: 1.6.4
Authors@R: c(person("Trevor L", "Davis", role = c("aut", "cre"), email="[email protected]"),
person("Allen", "Day", role="ctb", comment="Some documentation and examples ported from the getopt package."),
person("Python Software Foundation", role="ctb", comment="Some documentation from the optparse Python module."),
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
optparse 1.6.3
optparse 1.6.4
==============

* Fixes bug in printing help for ``action=="callback"`` when ``metavar==NULL`` (#29).
Expand Down
5 changes: 3 additions & 2 deletions R/optparse.R
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,16 @@ OptionParser <- function(usage = "usage: %prog [options]", option_list=list(),
#' help="Standard deviation if generator == \"rnorm\" [default %default]")
#'
#' @export
make_option <- function(opt_str, action="store", type=NULL, dest=NULL, default=NULL, help="", metavar=NULL, callback=NULL, callback_args=NULL) {
make_option <- function(opt_str, action="store", type=NULL, dest=NULL, default=NULL,
help="", metavar=NULL, callback=NULL, callback_args=NULL) {

# flags
short_flag <- opt_str[grepl("^-[[:alpha:]]", opt_str)]
if(length(short_flag) == 0) {
short_flag <- NA_character_
} else {
if (nchar(short_flag) > 2) {
stop(paste(short_flag, "must only be a '-' and a single letter"))
stop(paste("Short flag", short_flag, "must only be a '-' and a single letter"))
}
}
long_flag <- opt_str[grepl("^--[[:alpha:]]", opt_str)]
Expand Down

0 comments on commit c129526

Please sign in to comment.