-
-
Notifications
You must be signed in to change notification settings - Fork 40
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
User doesn't pass arguments to command #96
Comments
"pygbag" is a shortcut generated by pip installer, the canonical way to run is |
@pmp-p - Hello Paul, I'll first do a bit of research and learning on CLI tools and how Based on what you've told me, I assume this is a problem with |
i think pygbag is lacking a detection mechanism when len(sys.argv) is == 0 That situation may happen when calling it via pip entry point ( not really a shortcut, it is a tiny python program generated by pip in the path). |
@pmp-p - Thanks, that helps a ton! 😄 |
Might make a PR... Looks like this can be solved with some code in line 17 in if len(sys.argv) == 0:
print("...")
raise SystemExit(0) @pmp-p - I'm not sure how you're printing the help or support message. Is it just a massive string or something else...? |
it's a list of all what precedently failed, when that list is non-zero the program halts and report |
If I may, the way to call documentation is also slightly frustrating. I wasn't expecting |
--help is relative to current project target, it may change in the future based on projects templates. pygbag roots in posix, usage and help are different things. usage is not currently implemented on entry point script feel free to PR.
|
Machine:
macOS 12.6.5
Python 3.11.3
Pip 22.0.x (I'm not sure what the "x" is...)
Problem:
When calling the
pygbag
command in a terminal without any arguments, you get the following error:This is because the code tries to find an argument (with indices) when none are given, thus an
IndexError
is raised.Solution (suggestion):
Instead of throwing an ugly, long error, just give the user the "help" message. I've seen this done in other CL tools. When I ran the command
pygbag
, I expected a help message. Logically, this makes sense as if the user is new to the tool, and runs the comand without any flags or arguments, maybe they are confused, or don't know the tool works. Thus, a help message would, well, be helpful.The text was updated successfully, but these errors were encountered: