-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 add a required argument? #346
Comments
Doing it manually in a |
No need to apologize! I was just looking for the recommended way to get stuff done. 😄 Thank you for the quick reply! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am migrating my app over from another cli library (kingpin), and one of the things they let me do is document positional arguments, e.g.
cmd.Arg("name", "name of the thing").Required().StringVar(&name)
. I am having trouble understanding how to migrate that over. So far the best I have come up with is this:Basically I am documenting the arg in the Use string and then parsing the arg in RunE. This feels a bit awkward, is there something built-in that I am overlooking?
Thanks!
The text was updated successfully, but these errors were encountered: