Skip to content

Conversation

@miladev95
Copy link
Contributor

@miladev95 miladev95 commented Dec 10, 2025

  • Do only one thing
  • Non breaking API changes
  • Tested

What did this pull request do?

Adds a version subcommand that prints the current CLI version. The version can be set at build time using -ldflags "-X main.Version=x.y.z" and defaults to v0.2.4. This helps users identify which version they have installed for troubleshooting and bug reports.


Add CLI version subcommand with build-time override

Introduces a versionCmd() to the CLI that prints the current gorm-cli version. Declares a package-level Version variable defaulting to v0.2.4, which can be overridden during build via -ldflags "-X main.Version=...".

Key Changes

• Declared mutable Version variable with default v0.2.4 and build-time override instructions.
• Added versionCmd() returning a Cobra command that prints gorm-cli version <Version>.
• Registered the new version subcommand with the root Cobra command.

Affected Areas

main.go


This summary was automatically generated by @propel-code-bot

@propel-code-bot propel-code-bot bot changed the title Add version command Add CLI version command to display build version Dec 10, 2025
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