-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
draft of use_crate() #361
base: main
Are you sure you want to change the base?
draft of use_crate() #361
Conversation
|
||
cli::cli_abort( | ||
"{.var features} should be a character vector.", | ||
"i" = "You supplied an object of class {class(features)}.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this class()
call should grab the first element of the output. There may be 1 or more classes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point. are you thinking class(x)[1]
or is there a better way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that works for me! We could also utilize the obj_type_friendly()
standalone function.
https://github.com/r-lib/rlang/blob/main/R/standalone-obj-type.R
|
||
cli::cli_abort( | ||
"{.var git} should be a length one character vector.", | ||
"i" = "You supplied an object of class {class(git)} with length {length(git)}.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same thing here
|
||
cli::cli_abort( | ||
"{.var version} should be a length one character vector.", | ||
"i" = "You supplied an object of class {class(version)} with length {length(version)}.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same thing
lst <- rlang::dots_list(...) | ||
|
||
if (length(lst) > 0){ names(lst) <- paste0("--", names(lst)) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this part might be odd. this would probably need to be better described in the params and with an example. like optional = TRUE
becomes --optional true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are also flags that don't take a value, like --dev
. i wasn't sure how to handle those...
For #360