pallets / click

Python composable command line interface toolkit
https://click.palletsprojects.com
BSD 3-Clause "New" or "Revised" License
15.55k stars 1.39k forks source link

Split extra help item computing with help record rendering #2516

Open kdeldycke opened 1 year ago

kdeldycke commented 1 year ago

I maintain Click Extra, a drop-in replacement for Click which adds colorization of the help screen.

I am currently relying on finicky regular expressions to identify and match the extra items that are displayed at the end of each option's help. These extra items are rendered in square brackets and looks like:

The problem is that the generation of these extra items are deeply embedded within Click and are impossible to fetch independently.

That's why I propose a simple refactor of the Option.get_help_record() method, and split it in two:

I have a PR that is ready at #2517.

kdeldycke commented 1 year ago

Just wanted to ping @janluke on that issue, as he also maintain a Click-based extension that is also deep into help screen customization and coloring.

kdeldycke commented 1 year ago

I've also heard rumors of upcoming big refactors regarding help screen generation, so I propose this small, un intrusive one as a small step towards the big one.