-
Notifications
You must be signed in to change notification settings - Fork 38
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
Decorrelate format and printing #19
Comments
I'll have a think about this. It's my aim to mimic default click functionality by default, and I'm pretty sure that click prints to the terminal. But it's possible that click has a method to define the output method / return a string etc, in which case I will try to replicate that. Alternatively I guess we could have a new opt-in config option to return the console object. Needs a bit of thought though, at the moment I think rich-click uses several different console objects for example 🤔 |
I second this. I have implemented my own help command in click applications that uses Command.get_help to get the formatted help string. |
Ah ok, if this is different to the standard click functions then I'm more inclined to adjust it.. What is the function in Click that prints to the terminal then? How would you want to use the formatted help strings from rich-click, out of interest? |
My use case was related to auto-generate a complete README of all commands, and groups subcommands all at once, with this kind of code : https://github.com/AdrienPensart/click-skeleton/blob/master/click_skeleton/doc.py |
I think it's My use case is similar to @AdrienPensart and also I've implemented a custom Click Command that overrides |
I believe that with rich-click pip install rich-click==1.8.0dev2
The formatter object still needs a little work, but in fairness to us, it is a little weird because we have to kind of force it to work with the rich Console(). Square peg in round hole. I think other than that we're in a great spot. I'm going through and cleaning the backlog up, and I'm closing this issue given the sheer amount of abstraction work that's gone on between myself and @BrutalSimplicity. Please re-open an issue if you have any specific concerns still. |
I think something is incompatible in the way rich_format_help is not only formatting the output string
but it's printing it too !
I think this function should just return the formatted string (a rich object is ok) and then let the user choose the Console object himself or another way to print the string.
The text was updated successfully, but these errors were encountered: