-
Notifications
You must be signed in to change notification settings - Fork 122
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
Why is TermUi.echo(..) deprecated #366
Comments
See #344 for discussion, but the summary is that it was that it was confusing to offer multiple ways to do the same thing. Additionally, Can you provide more information on what you're trying to do with your helper functions? Maybe we can come up with a design that fits that use case without the downsides of the current TermUi |
Thanks. I had a feeling there was something subtle I was missing. I'm making a CLI tool for managing versions for other cli-tools. Sample usage I would have helper file for instance GithubHelper for downloading binaries from release pages on github and was hoping to echo relevant info to stdout in helper methods. |
How about passing in the console or command as a parameter (or extension) to your helper methods? Then the helpers would still use the right console instance rather than the global one. |
Yes. It is a possibility. I solved by a callback parameter. But felt it introduced unneccecary complexity. Anyway. I feel I understand better now and can close the issue if you want. |
Alright. Thanks for the feedback! |
TermUi.echo(..) is @deprecated, but all the suggested alternative do is call the very same deprecated method. What is the reasoning here?
I am very tempted to use the @deprecated TermUi.echo(..) method because i want to extract logic to helper functions to hide details from my implemented CliktCommands.
An alternative could be to create helper-methods that are extension functions of CliktCommand, but since CliktCommand.echo(..) is protected that is not possible.
The text was updated successfully, but these errors were encountered: