Skip to content

fix: add --version flag and skip orphan temp files#45

Open
leno23 wants to merge 1 commit into
dolph:mainfrom
leno23:fix/version-flag-and-skip-temp-files
Open

fix: add --version flag and skip orphan temp files#45
leno23 wants to merge 1 commit into
dolph:mainfrom
leno23:fix/version-flag-and-skip-temp-files

Conversation

@leno23
Copy link
Copy Markdown

@leno23 leno23 commented May 17, 2026

Summary

  • Add version.go for ldflags-injected build metadata and -v/--version.
  • Prefix rewrite temp files with .find-replace- and skip them on later runs.

Fixes #26
Fixes #21

Made with Cursor

Declare ldflags version variables, support -v/--version, prefix
rewrite temp files with .find-replace-, and ignore those files on
subsequent runs after interrupted rewrites.

Fixes dolph#26
Fixes dolph#21

Co-authored-by: Cursor <cursoragent@cursor.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f8e50685bc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread find_replace.go
log.Fatal("Usage: find-replace FIND REPLACE")
showVersion := flag.Bool("version", false, "print version and exit")
showVersionShort := flag.Bool("v", false, "print version and exit (shorthand)")
flag.Parse()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Handle leading-dash search terms

Calling flag.Parse() here makes the first positional argument go through flag parsing, so invocations like find-replace -foo bar now fail with an unknown-flag error instead of treating -foo as the literal search string. Before this commit, any two strings were accepted via os.Args, so this is a functional regression for users replacing tokens that begin with - (common in CLI/docs text) unless they know to add --.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant