Can i optionally pass argument to gatling commandline

there are some scenario i need to run against specific number of users irrespective of total duration of test run. and some run against total duration irrespective of users.
hence, setting “-Dusers -Dduration” while executing a mvn command should run tests against users and if i dont pass “-Dusers” in mvn command, test should run agsinst the duration. Is there any option to do so?

Please check Example:
or thread:
Cannot Grab Command Line Arguments

Thanks for your suggestion. I think these are commands to be sent mandatorily while execution. But, my question is to run these optionally.
For ex: if i mention “-DrunSmokeTest=yes”, it should run the smoke test. Else (if i dont give the argument “-DrunSmokeTest”, it has to run the entire test

I don’t understand what you want to achieve.
Can you elaborate a little more your needs.

Perhaps this thread about configuring a list of scenarios may help you: