title: In the startup scripts generated by gradle's application plugin, how can I have the program name passed in to the application?
body: <p>Executing the gradle application plugin's <code>installDist</code> task creates a directory <code>build/install/<em>my-application-name</em>/bin</code> that contains wrapper scripts, <em><code>my-application-name</code></em> and <code><em>my-application-name</em>.bat</code>. Running either of these scripts runs the application, and arguments passed to these scripts are passed to the underlying application.</p>
  
  <p>In UNIX shell scripts you can access the name that was used to execute the program as <code>$0</code>. In fact, the UNIX version of the gradle-generated startup script uses <code>$0</code> several times.</p>
  
  <p>How can I configure the gradle application plugin such that these scripts will pass the value of <code>$0</code> (and whatever the Windows equivalent is on Windows) into the underlying application, perhaps as a Java system property?</p>