Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

draft of use_crate() #361

wants to merge 1 commit into from

Conversation

kbvernon
Copy link
Contributor

For #360


cli::cli_abort(
"{.var features} should be a character vector.",
"i" = "You supplied an object of class {class(features)}.",
Copy link
Contributor

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

Copy link
Contributor Author

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?

Copy link
Contributor

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)}.",
Copy link
Contributor

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)}.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same thing

Comment on lines +107 to +109
lst <- rlang::dots_list(...)

if (length(lst) > 0){ names(lst) <- paste0("--", names(lst)) }
Copy link
Contributor

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

Copy link
Contributor Author

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants