feat: tmpo [-v | --version | version] Command#11
Merged
Conversation
Introduces a new hidden 'version' subcommand in cmd/version.go, centralizes version output formatting in GetVersionOutput, and updates root command to use this function. This improves maintainability and consistency of version information display.
tmpo [-v | --version | version Commandtmpo [-v | --version | version] Command
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request refactors how version information is displayed and introduces a dedicated
versionsubcommand. The main improvements are the extraction of version formatting logic into reusable functions and the addition of a hiddenversioncommand for consistent version output.Enhancements to version information handling:
versionsubcommand incmd/version.gothat displays version details, including the build date and a changelog URL. This command is hidden but can be invoked directly.GetVersionOutput,GetFormattedDate, andGetChangelogUrlhelper functions incmd/version.gofor reuse by both the CLI flags and the new subcommand.cmd/root.goto use the newGetVersionOutputfunction, ensuring consistent version output across the application.Code cleanup:
fmtimport fromcmd/root.go.