Skip to content

feat: add version metadata and CLI -h/-v flags#94

Open
leno23 wants to merge 1 commit into
dolph:mainfrom
leno23:feat/version-flag-issue-26-v2
Open

feat: add version metadata and CLI -h/-v flags#94
leno23 wants to merge 1 commit into
dolph:mainfrom
leno23:feat/version-flag-issue-26-v2

Conversation

@leno23
Copy link
Copy Markdown

@leno23 leno23 commented May 31, 2026

Summary

  • Declare build-time ldflags variables (GitTag, GitCommit, etc.) and print them via -v/--version
  • Add -h/--help usage output instead of only failing on wrong arity
  • Stamp release workflow binaries with the same metadata as build.sh

Test plan

  • go test -run 'Version|Help' ./...
  • ./find-replace --version shows stamped metadata after build

Fixes #26

Made with Cursor

Declare ldflags-injected build variables, print them for -v/--version,
and add -h/--help usage. Stamp release binaries with the same metadata
as build.sh.

Fixes dolph#26
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: dfc9137a12

ℹ️ 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
// Remove date/time from logging output.
log.SetFlags(0)

if len(args) == 2 && (args[1] == "-v" || args[1] == "--version") {
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 Document the new CLI flags

AGENTS.md says any added flag or subcommand must update the README in the same PR. This block adds -v/--version (and the -h/--help block below), but README.md still documents only find-replace FIND REPLACE, so users have no documented way to discover the new supported flags and the change violates the repo's CLI-surface rule.

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

Development

Successfully merging this pull request may close these issues.

Build-time version metadata is injected via -ldflags but never referenced; no --version flag

1 participant