-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
How to make 'version' subcommand call 'root --version' #724
Comments
6 tasks
This issue is being marked as stale due to a long period of inactivity |
This is still relevant. |
@eine This works for me in a small test program:
|
Asked and answered. Closing. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am trying to add a
version
subcommand torootCmd
which will produce the same result as executingroot --version
.The following code is properly compiled but it produces a runtime error:
So I looked in the sources of cobra and came up with:
This produces the desired result:
root version
androot --version
produce the same output. However, I find the requirement to replicate the snippet strange.Can anyone help me find the correct single instruction that allows to execute the root 'recursively'?
The text was updated successfully, but these errors were encountered: