Skip to content
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

Specifying users in CLI should use a keyword parameter #2745

Open
2 tasks done
bakhtos opened this issue May 28, 2024 · 2 comments · May be fixed by #2786
Open
2 tasks done

Specifying users in CLI should use a keyword parameter #2745

bakhtos opened this issue May 28, 2024 · 2 comments · May be fixed by #2786
Assignees

Comments

@bakhtos
Copy link
Contributor

bakhtos commented May 28, 2024

Prerequisites

Description

Currently, particular Users to run are specified on the command line like this

User classes:
  <UserClass1 UserClass2>
                        At the end of the command line, you can list User
                        classes to be used (available User classes can be
                        listed with --list). LOCUST_USER_CLASSES environment
                        variable can also be used to specify User classes.
                        Default is to use all available User classes

Doing this

at the end of the command line

as positional arguments is awkward if the command is big. The list of users should be a keyword CLI parameter like --users UserClass1 UserClass2, then it can be specified in any order of arguments in the command.

@bakhtos bakhtos changed the title Specifying users in CLI should use a keyword paremeter May 28, 2024
@cyberw
Copy link
Collaborator

cyberw commented May 28, 2024

I completely agree. If you can do it in a backwards-compatible way and update the docs I’m all for it.

If I could rewrite history, the positional parameter would be the locustfile (but I’m not sure its worth changing right now). If we were to do that we’d have to be careful though (bump major version, give good error messages, etc. And I guess that wasn’t your point anyway :)

@bakhtos
Copy link
Contributor Author

bakhtos commented May 29, 2024

@cyberw I believe it is possible to pickup the arguments both ways and then just merge the lists before passing it on. We can just leave the old way there but omit it from the documentation so that old scripts work but new users only learn the new way. I will work on this eventually. You can assign the issue to me

@bakhtos bakhtos linked a pull request Jul 2, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants