Replies: 2 comments
-
Anyone? Is there no longer support for Thor? |
Beta Was this translation helpful? Give feedback.
0 replies
-
This is still unanswered. Is there is a solution for extending classes? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a design where I've created a
RepositoryCLI
class that its intent is to provide a way to checkout a GitHub repository provided a GitHub URL and a branch name. I want to allow options like:aliases: %w[-c --checkout-location]
- to allow specifying a location for the project to be checked out toaliases: %w[-r --repo]
- GitHub URLaliases: %w[-b --branch]
- GitHub branch nameNow the challenge is that I have two different CLI classes that are different 'types' of repository CLIs that want the same information and then some other information. So lets say I have a
SourceCLI
and aDestinationCLI
. I want these to be able to extend fromRepositoryCLI
and ask for their own options plus all the options inherited fromRepositoryCLI
.What I have been doing is something like this as a Module mixin:
It's doable but I really wanted to know if anyone has solved this a different or more elegant way. I'm finding myself repeating this pattern even with stuff like logging level. That is what I have in my
BaseCLI
where I allow for the-v
or--verbose
for my logging on any command I run to assist in debugging my CLI commands or just to present more information to my consumer.If anyone has an idea, let me know. I'm open to alternatives.
Beta Was this translation helpful? Give feedback.
All reactions