Skip to content

Add r (read file) command#5

Closed
erikgaas wants to merge 2 commits intomainfrom
erikgaas/add_r
Closed

Add r (read file) command#5
erikgaas wants to merge 2 commits intomainfrom
erikgaas/add_r

Conversation

@erikgaas
Copy link

@erikgaas erikgaas commented Mar 10, 2026

Adds the classic ex r command to exhash — reads a file's contents and inserts them after the addressed line.

Changes

  • parse.rs: New Subcommand::Read { path: String } variant, parses r filepath after lnhash address. Also allows 0|0000| with r (same as a/i).
  • engine.rs: New read_file method that reads the file, splits into lines, and reuses append_after to insert them.

Example

# Insert contents of other.txt after line 2
2|f7c4|r other.txt

@erikgaas erikgaas marked this pull request as draft March 10, 2026 21:49
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.

1 participant