Skip to content
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

Use importable (cobra-)run functions #493

Closed
PrivatePuffin opened this issue Jun 2, 2024 · 2 comments
Closed

Use importable (cobra-)run functions #493

PrivatePuffin opened this issue Jun 2, 2024 · 2 comments

Comments

@PrivatePuffin
Copy link

PrivatePuffin commented Jun 2, 2024

It would be nice if the functions under cobra-run, are split-off into a separately exported functions.

That allows custom go tooling, to call the functions (and send them their args), as well.
Which would now basically require writhing custom variants/copies of those run sections.

Its a relatively minor change to tooling, but significantly increases usability.
I'm okey with sending in the PR myself btw :)


Note, i'm aware there is more to things at times than just the run section, primarily setting/getting of flags, but thats relatively manageable in scope compared to the, sometimes extensive, run sections

@budimanjojo
Copy link
Owner

Do you mean exporting the subcommands of the program? I'm not sure if this is a good idea because it's very program specific functions and they're mostly just calling the exported functions from the pkg directory anyway. Maybe if you can state your use case for it might give me better explanation because I don't quite understand your request tbh.

@PrivatePuffin
Copy link
Author

We're moving some tooling from bash to go.
But we've since gone over it more completely and you're correct: it wouldn't really solve much at all, as everything is too interconnected. A simple export wouldn't do anything of relevance!

Sorry for the bother!

@PrivatePuffin PrivatePuffin closed this as not planned Won't fix, can't repro, duplicate, stale Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants