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

Allow passing R arguments to rig run #249

Open
AdrienLeGuillou opened this issue Sep 19, 2024 · 10 comments
Open

Allow passing R arguments to rig run #249

AdrienLeGuillou opened this issue Sep 19, 2024 · 10 comments

Comments

@AdrienLeGuillou
Copy link

Hi,

is there a way to pass R arguments like --no-save to rig run?

something like rig run -- --no-save

Thanks

@gaborcsardi
Copy link
Member

AFAICT it never saves the data, so you don't need --no-save. Which arguments would you like to use in particular?

@AdrienLeGuillou
Copy link
Author

I do get the Save workspace image? [y/n/c]: prompt when quitting with Ctrl-D (or the signal sent by iron.nvim) and as well with just q().

I can make an alias

  q <- function(save="no", ...)  quit(save = save, ...)

in my .Rprofile but that does not change the behavior on Ctrl-D

@klmr
Copy link

klmr commented Sep 19, 2024

Specifying --no-save does make a difference:

$ rig run
[…]
> q()
Save workspace image? [y/n/c]: ^D
$ R --no-save
[…]
> q()
[quits without prompt]

@AdrienLeGuillou
Copy link
Author

weirdly not in my case

I > R --no-save
[..]
> q()
Save workspace image? [y/n/c]: n

let me check on another computer

@AdrienLeGuillou
Copy link
Author

ok apparently that has to do with an alias malfunctioning on my end.
Very sorry for that

@gaborcsardi
Copy link
Member

Oh, right, so you are running it without any arguments? Then it would indeed make sense to be able to pass some arguments....

@AdrienLeGuillou
Copy link
Author

Yes, I guess having a way to pass argument into rig run to the sub call (R, RScript, etc) could be useful.

I suggested rig run -- --no-save as it reminds me of cargo run a_project -- arguments_to_the_project

@klmr
Copy link

klmr commented Sep 19, 2024

A modest proposal: make rig run an alias for R --no-save --no-restore instead of currently just R, to shed some historical ballast (the default R settings of saving/restoring globalenv is daft).

@gaborcsardi
Copy link
Member

@klmr Yeah, I like that.

@gaborcsardi gaborcsardi reopened this Sep 19, 2024
@TymekDev
Copy link
Contributor

I wouldn't mind having either --vanilla or --no-init-file and --no-site-file. I find it useful when working in a renv project, but wanting do something outside the limited library (e.g. check docs of a package I have installed globally).

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

No branches or pull requests

4 participants