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

Reused option name: -j is used for both JSON and emoji options #73

Open
edrogers opened this issue Oct 21, 2022 · 2 comments · May be fixed by #74
Open

Reused option name: -j is used for both JSON and emoji options #73

edrogers opened this issue Oct 21, 2022 · 2 comments · May be fixed by #74

Comments

@edrogers
Copy link

The -j option name is listed for both the "Display as JSON" and "Enable emoji code" options in the code and documentation (including the splash screen image in the README). Click's option decorator silently allows one to overwrite the other. As a result, the JSON display option currently has no single-letter option name. To use it, one has to call --json.

Since the JSON option is older than the emoji option, I propose capitalizing the single-letter emoji option to -J. This would be a breaking change. I'll submit a PR for you to consider if this seems like a good approach.

@edrogers edrogers linked a pull request Oct 21, 2022 that will close this issue
@harkabeeparolus
Copy link

Well spotted! 😄

I would like to point out, however, that one might argue for doing this the other way round. Since -j currently means --emoji, and --json does in reality not have a short option, this could be a non-breaking change if the new -J option were to mean --json.

Personally I actually prefer your breaking change since JSON is a lot more common for me than console markup with emoji codes... But I would like to mention this alternative for the sake of completeness.

@edrogers
Copy link
Author

I agree, using -J for JSON would avoid the breaking change. But I also would prefer JSON to be lowercased as it is a much more common use-case

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 a pull request may close this issue.

2 participants