title: How to get grunt task name given on command line?
body: <p>In order to customize my grunt tasks, I need access to the grunt task name given on the command line when starting grunt.</p>
  
  <p>The options is no problem, since its well documented (grunt.options).
  It's also well documented how to find out the task name, <em>when running a grunt task</em>.</p>
  
  <p>But I need access to the task name before.</p>
  
  <p>Eg, the user writes
  <code>grunt build --target=client</code></p>
  
  <p>When configuring the grunt job in my <code>Gruntfile.js</code>, I can use
  <code>grunt.option('target')</code> to get <code>'client'</code>.</p>
  
  <p>But how do I get hold of parameter <code>build</code> before the task build starts?</p>
  
  <p>Any guidance is much appreciated!</p>