title: Gradle task - pass arguments to Java application
body: <p>I have a Java application that runs with a custom gradle task and the application requires some arguments upon being invoked. These are:</p>
  
  <pre><code>programName ( string | -f filename | -d key | -h)
  Options:
      string         Message to be used.
      -d key         Use default messages, key must be s[hort], m[edium] or l[ong].
      -f filename    Use specified file as input.
      -h             Help dialog.
  </code></pre>
  
  <p>Gradle task looks like:</p>
  
  <pre><code>task run (type: JavaExec){
      description = "Secure algorythm testing"
      main = 'main.Test'
      classpath = sourceSets.main.runtimeClasspath
  }
  </code></pre>
  
  <p>I've tried running <code>gradle run -h</code> and it does not work.</p>