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

Change the CLI name to match the project name #88

Merged
merged 1 commit into from
Dec 1, 2023
Merged

Change the CLI name to match the project name #88

merged 1 commit into from
Dec 1, 2023

Conversation

eitamal
Copy link
Contributor

@eitamal eitamal commented Dec 1, 2023

Background

oauth2c uses cobra as the CLI framework and GoReleaser for releases.

  • cobra uses the first word of the root command's Use field to determine the name of the CLI command.
  • GoReleaser uses the project_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 the Use field for the root command to match the binary name.

@mbilski mbilski merged commit 2116c28 into cloudentity:master Dec 1, 2023
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.

3 participants