Skip to content

Use Cobra's PreRun function to parse the arguments #1539

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

Open
umbynos opened this issue Nov 5, 2021 · 0 comments
Open

Use Cobra's PreRun function to parse the arguments #1539

umbynos opened this issue Nov 5, 2021 · 0 comments
Assignees
Labels
topic: CLI Related to the command line interface topic: code Related to content of the project itself type: enhancement Proposed improvement

Comments

@umbynos
Copy link
Contributor

umbynos commented Nov 5, 2021

We already use the PreRun here
We could leverage it to consume the args given to a command before running the actual run function
https://github.com/spf13/cobra/blob/master/user_guide.md#prerun-and-postrun-hooks

@umbynos umbynos added topic: CLI Related to the command line interface topic: code Related to content of the project itself type: enhancement Proposed improvement labels Nov 5, 2021
@umbynos umbynos self-assigned this Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: CLI Related to the command line interface topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

No branches or pull requests

1 participant