-
-
Notifications
You must be signed in to change notification settings - Fork 102
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
Description strings for subcommands #214
Comments
Yeah, seems reasonable. Happy to implement this. |
Well ok the reason for this is that subcommands are nil pointers when the help string for the parent command is being printed. I didn't want to assume that you could safely call Description() on a nil struct. I think most implementations of Description() just return a static string, or at least do not access the receiver struct, but still some users might be confused by having Description() invoked with a nil receiver. The way to get the output you want, though will in involve repetition in your code, is to add a var args struct {
Commit *commitCmd `arg:"subcommand" help:"Record changes to the repository"`
} I'm still open to implementing this, just considering options carefully. |
Yeah, sure that'd do as well -- simpler=better. Just that, when running
but I think the first line better be:
|
Besides giving a descriptive message to the main program, please consider adding them for subcommands as well, like
git
:and use it for subcommand helps as well:
I.e., instead of:
The first line better be
commit - Record changes to the repository
The text was updated successfully, but these errors were encountered: