-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Custom arguments' help is not shown when calling locust --help
#2917
Comments
Yea this is a real bug. I think your suggested fix sounds reasonable and would love for you to PR it! |
@fstamour is anyone working this ? , would like to have a crack at it |
I would like to work on this if there's any chance..? @cyberw |
Go for it. I meant to assign it to you. |
Hey @cyberw @fstamour I was having some trouble to set up this project locally but after a succcessful setup now I am stuck with how to get to the fix.. The possible fix provided when executed refers to a conflict addressing the pre-existence of a default help argument.. If you can maybe elaborate further on the possible fix, I'll get it working |
@shauryapanchal make sense? |
Prerequisites
Description
(I'm not certain you would consider this a bug or a feature request.)
How to reproduce
locust.conf
file in the current directorylocust --help
(or evenlocust -f locustfile.py
)Expected result
locust
to load thelocustfile.py
and run theinit_command_line_parser
hooklocust --help
's outputActual result
locustfile.py
is not loaded at all when runninglocust --help
.locust --help
's output.Possible fix
Replace the built-in help action by something that loads the locustfile before printing the help.
--help
argument (parser.add_argument('-h', '--help', action="store_true" ...
)args.help == True
parser.print_help()
andparser.exit()
(just like the default_HelpAction
does)Command line
locust --help
Locustfile contents
Python version
Test with both Python 3.10.12 and 3.12.6
Locust version
2.31.6
Operating system
Ubuntu 22.04.4 LTS and 24.04 LTS
The text was updated successfully, but these errors were encountered: