Skip to content

Add startup search option#429

Closed
TIR44 wants to merge 1 commit into
walles:masterfrom
TIR44:feature/default-search-option
Closed

Add startup search option#429
TIR44 wants to merge 1 commit into
walles:masterfrom
TIR44:feature/default-search-option

Conversation

@TIR44

@TIR44 TIR44 commented May 31, 2026

Copy link
Copy Markdown

Fixes #389

Repro / motivation

moor already supports interactive search, but there was no CLI equivalent for tools such as delta to open a file with an initial search term ready for n / p navigation.

Fix

Added --search <pattern>:

  • parses the startup search term from CLI args
  • applies it through the existing pager search state on startup
  • jumps to the first visible match when possible
  • leaves the pager in normal viewing mode so n and p work immediately
  • documents the option in the man page

Tests

  • go test ./cmd/moor ./internal -run 'TestSearchOption|TestInitialSearch|Test152|TestScrollToNextSearchHit'
  • go test ./...
  • ./build.sh && MOOR_SKIP_INTERACTIVE_TESTS=1 ./test.sh

@isao isao mentioned this pull request Jun 11, 2026
@walles walles closed this in c338274 Jun 12, 2026
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.

Add cli option to provide a default search term

1 participant