Skip to content

feat: accept all R-compatible CLI flags#111

Merged
eitsupi merged 3 commits intomainfrom
feat/r-cli-flags-compat
Mar 8, 2026
Merged

feat: accept all R-compatible CLI flags#111
eitsupi merged 3 commits intomainfrom
feat/r-cli-flags-compat

Conversation

@eitsupi
Copy link
Copy Markdown
Owner

@eitsupi eitsupi commented Mar 8, 2026

Summary

  • Add -f/--file flag as alias for positional SCRIPT argument (closes Making arf play nicely with R-nvim #110)
  • Add --restore, --args, and memory tuning flags (--max-connections, --max-ppsize, --min-nsize, --min-vsize) forwarded to R
  • Add no-op flags for compatibility: --verbose, --encoding, --gui, --arch, --debugger, --debugger-args
  • Fix --restore-data incorrectly passed to R (not a valid R flag); now correctly passes --restore

Background

After #109, the same user reported #110 — R-nvim passes -f to arf which was rejected. Rather than playing whack-a-mole with individual flags, this PR systematically adds all remaining flags from R --help so that tools like R-nvim, ESS, and others can launch arf without errors.

All new flags are hidden from short help (-h). Functional flags are forwarded to R; others are accepted silently as no-ops.

Test plan

  • cargo clippy passes
  • CLI snapshot tests updated and passing
  • Manual verification: arf -f /dev/null, arf --args, arf --max-ppsize=200000 --verbose --encoding=UTF-8 --gui=X11 --arch=x86_64 -d gdb --debugger-args=-q --restore all accepted

🤖 Generated with Claude Code

eitsupi and others added 3 commits March 8, 2026 10:51
Add support for all remaining R CLI flags to prevent errors when tools
like R-nvim pass R-standard flags to arf.

Functional flags (forwarded to R):
- -f/--file: script input file (alias for positional SCRIPT arg)
- --restore: restore previously saved objects
- --max-connections, --max-ppsize, --min-nsize, --min-vsize: R memory tuning

No-op flags (accepted silently for compatibility):
- --verbose, --encoding, --gui/-g, --arch, --args
- --debugger/-d, --debugger-args

Also fixes --restore-data being passed to R (not a valid R flag);
now correctly passes --restore.

Closes #110

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Document that arf's --args does not consume trailing arguments
unlike R's behavior, so unknown flags after --args will still
cause a parse error.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
On Windows, Instant is relative to boot time, so subtracting a duration
longer than system uptime causes a panic. Use checked_sub and skip the
test if uptime is too short.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@eitsupi eitsupi merged commit 2b6d0e7 into main Mar 8, 2026
10 checks passed
@eitsupi eitsupi deleted the feat/r-cli-flags-compat branch March 8, 2026 11:08
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.

Making arf play nicely with R-nvim

1 participant