janluke / cloup

Library to build command line interfaces based on Click. It extends click with: option groups, constraints (e.g. mutually exclusive params), command aliases, help themes, "did you mean ...?" suggestions and more.
https://cloup.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
104 stars 10 forks source link

Custom MultiCommands (with styling) #154

Closed wabiloo closed 1 year ago

wabiloo commented 1 year ago

I am trying to enable a plugin-based architecture, along the lines of the click documentation at https://click.palletsprojects.com/en/8.1.x/commands/#custom-multi-commands.

However, when I do that, naturally the output looks black and white, and not the cloup colored output I've got used to.

I was thinking I could just replace the inheritance to cloup.MultiCommand, but that does not seem to exist.

Am I missing something obvious?

janluke commented 1 year ago

Try extending cloup.Group or take inspiration from the the following branch and discussion:

janluke commented 1 year ago

Have you solved your problem?

wabiloo commented 1 year ago

I tried inheriting from cloud.Group instead of click.MultiCommand, but that didn't work (the sub-commands did not get listed). I need to review your lazy loading example