Change the CLI name to match the project name #88
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.
Background
oauth2c
uses cobra as the CLI framework and GoReleaser for releases.cobra
uses the first word of the root command'sUse
field to determine the name of the CLI command.GoReleaser
uses theproject_name
variable in the.goreleaser.yaml
file or an inferred name from the GitHub release to pick the project name.Problem
I believe at some point the project was migrated from cloudentity/oauthc to cloudentity/oauth2c. However, the name of the CLI was kept the same with the migration. So, GoReleaser has automatically changed to release
oauth2c
under the new name, but cobra is still using the old name.The name mismatch isn't much of a problem for most use cases. But, primarily for cobra built-in functionality, where the cobra name is used (e.g.
--help
, completions, etc.), the name mismatch leads to incorrect behaviour, such as completions not working since they're generated with the wrong name.Solution
Quite a long-winded explanation for a single character change 😅 but it's pretty straightforward; I've just added the missing
2
from the name in theUse
field for the root command to match the binary name.