I create a listener for new command line argument:
@events.init_command_line_parser.add_listener
def init_parser(parser):
parser.add_argument("--stages", type=str, env_var="LOCUST_STAGES", help="It's working")
but I don't have a clue how to get access to this value. Trying something like:
@events.init.add_listener
def _(environment, **kw):
os.environ['stages'] = environment.parsed_options.stages
But there is no effect, because command : os.environ.get('stages') returns None
How should I get this value? Especially if I only use it with others like:
locust -f locustfiles/file.py --tag some_tag --stages stages.json