Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add version option to display app version #26

Merged
merged 1 commit into from
Mar 31, 2024
Merged

Conversation

catatsuy
Copy link
Owner

This pull request primarily introduces a versioning feature to the purl command-line tool, which is a versatile text processing tool. The changes include the addition of a -version flag to display the version of the tool, the inclusion of build information in the version output, and updates to the build process to incorporate versioning information. The changes also include the necessary modifications to the test suite to accommodate the new versioning feature.

Here are the most important changes:

Versioning feature:

  • cli/cli.go: Introduced a version function that retrieves the build information if available, otherwise defaults to "(devel)". Added a Version variable and an appVersion field to the CLI struct. Modified the NewCLI function to initialize appVersion with the version information. Added a condition in the Run method to check for the -version flag and print the version information if the flag is set. [1] [2] [3] [4]

  • cli/cli.go: Updated the parseFlags function to include a -version flag. Modified the usage message to include the version information.

  • README.md: Updated the documentation to include the -version flag.

Build process:

  • Makefile: Modified the bin/purl target to include go.mod and go.sum as dependencies and to include versioning information in the build flags.

Test suite:

@catatsuy catatsuy merged commit 35220d7 into main Mar 31, 2024
1 check passed
@catatsuy catatsuy deleted the feature_add_version branch March 31, 2024 07:46
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