How to run gradle task that accepts “–debug” argument without gradle interpreting “--debug” as an argument to itself?

I have a custom task that looks like this that is causing issues when I try to run it:

Path
     :runApp
Type
     RunAppTask (com.x.proj.tasks.runApp)
Options
     --debug     The tag is to enable debug mode

When I try gradle runApp --debug it seems like gradle interprets the --debug as an argument to gradle itself and not the task. Is there a way to prevent this behavior other than renaming the argument in the task?

I don’t think so, unfortunately