Replies: 1 comment
-
I am a bad Go reader, and nobody answers, so I'll try to understand. What is your usage string? usage: compcli <command>
commands:
a
b And what do you want to do? Avoid repeating the same initialization code for "a" and "b"? |
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
-
Hi guys
My question is related to v3 still maybe there's some general idea for that across all the implementations.
Basically I' m interested is there any proper (intended by design) way for (co)composition across the subcommand hierarchy of
As it seems from the first glance any other endpoint command
Action
is almost kind of standalone function whilecli
framework is only just about to compose incoming configuration for it.Still what about the dependance and logic sharing across the sibling commands.
I.e. instead of composition of repeatable code just in place of Actions their selves as follows (almost pseudocode )
Is it possible to resolve such sharing/decomposition by means of
cli
framework it self.E.g. something like
Actually it is obviously not the solution, as Actions are ment to return errors only and their context is not that mutable. Still this is something closest came to a mind to describe the idea.
Anyway is it really possible to organize something similar by
cli
means it self by design? Or maybe are there any other well known best practice patterns / work arounds for that.Thanks
Beta Was this translation helpful? Give feedback.
All reactions