-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Added 'no_args_is_help' to Command #502
Conversation
If this isn't good enough for your code base, let me know what I can do to fix it. |
+1 |
Can you rebase @jdell64 ? |
I'm really sorry, I'm new to this. Rebase? On Tuesday, May 31, 2016, Tony Narlock notifications@github.com wrote:
Richard J Tindell Ps 102:18- "This will be written for the generation to come, That a people |
Would I be rebasing because they don't want it in their code base? I was told this was just 'bikeshedding' so they wouldn't merge my request in. (I may still be missunderstanding). |
Okay, I'll actually merge this in. Please rebase (to resolve the branch conflicts), and also address the comments I'll make in the diff. |
@@ -0,0 +1 @@ | |||
{} |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
@jdell64 Are you still interested in this? There is one inline comment that needs addressing. Thanks! |
Sure! I'll take a look
|
This misunderstanding has occured in my own tooling: pimutils/todoman#48 (comment) What do you think about adding a sentence like "See |
Hey, sorry, just got back around to your comment. Do you still need me to do this? |
If you consider the alternative solution I proposed (see last comment) acceptable I would prefer it over the added no_args_is_help. |
Sounds good. I will try to get this done soon.
… On Dec 2, 2016, at 4:28 PM, Markus Unterwaditzer ***@***.***> wrote:
If you consider the alternative solution I proposed (see last comment) acceptable I would prefer it over the added no_args_is_help.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@untitaker This patch actually aligns command user experience with group user experience. It seems that similar experience is less confusing. So I would prefer @jdell64 approach. |
OK, since it seems that neither this PR or its rebased version #804 won't be merged, I've found the following WA useful:
Than I use it this way: I'm placing it before decorator that passes context to callback (this way all parameters and options already caught by click):
This is far from ideal since I need to deal with default values of parameters but it is working pretty well and it is simple. |
If the domain, was printing help message if no options were passed, I have implemented simple one here: Maybe it will be helpful, if somebody looking for something similar. But it is still not the best solution in term of usability:
|
An important feature of command line tools is they spit out a brief usage pattern and point you to more help. For example:
This makes programs self-documenting because you run it and see and see "ah, this is the expected usage pattern and here's how I get help". From there you're off to the races! |
@roryhr I can't tell whose side you're on, but to me this is actually a reason why I consider the current behavior to be fine. Just barfing out the help output in response to an invalid invocation seems like a too un-personal response to the user action. |
A short help is nice, but getting the whole |
I added the
no_args_is_help
param to the Command class. I also created a test intest_commands.py
: