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

Helpers for error messages #38

Closed
hadley opened this issue Jan 23, 2018 · 6 comments · Fixed by #251
Closed

Helpers for error messages #38

hadley opened this issue Jan 23, 2018 · 6 comments · Fixed by #251
Labels
feature a feature request or enhancement

Comments

@hadley
Copy link
Member

hadley commented Jan 23, 2018

(Meta issue, will edit as I come across more small helpers):

dir_copy(c("foo", NA_character_, "bar", NA_character_), "blah")
#> Error: `path` must not have missing values
#> NAs found at 1,000,000 locations: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ...
  • Number formatting (e.g. set big mark)
  • Commas + truncation
  • Standard wrappers for argument names, paths, expressions
@jimhester
Copy link
Member

r-lib/fs@df2252a is the code I am using in fs for this

@gaborcsardi
Copy link
Member

Maybe #37 is relevant here, the inline markup part.

@gaborcsardi
Copy link
Member

Should this be in cli at all? Shall we use glue for the formatting? I think we already have some of these functions in other packages, no? Where?

@hadley @jimhester

@hadley
Copy link
Member Author

hadley commented Sep 25, 2018

I think some of probably belong in cli — e.g. cli should provide standard colours + text formatting for when we put an argument name or a string in a message. But maybe you're thinking that should live in a higher level package where those settings can be controlled with a theme?

@gaborcsardi
Copy link
Member

A common theme would be definitely nice. Theming is now in the cliapp package, but that's a bit too heavy as it is now, for a low-level infrastructure package, it needs xml2, selectr, progress. It is possible that we don't need hierarchical theming for CLI apps. OTOH it is really nice to have it. We can work on thinning its dependencies.

@gaborcsardi
Copy link
Member

OK, this will be proposed for after the coming 1.1.0 version, and I'll collect some use cases and mock up some API.

@gaborcsardi gaborcsardi added the feature a feature request or enhancement label Nov 22, 2019
gaborcsardi added a commit that referenced this issue Apr 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants