Textualize / rich-cli

Rich-cli is a command line toolbox for fancy output in the terminal
https://www.textualize.io
MIT License
3.1k stars 77 forks source link

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

Open edrogers opened 2 years ago

edrogers commented 2 years ago

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.

harkabeeparolus commented 2 years ago

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 commented 2 years ago

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