title: Multiple commands/tasks with Visual Studio Code
body: <p>I have a local folder that I use as a scratch pad for multiple little sample and toy pieces of code. I store a host of python, C++, shell scripts etc. in this directory.</p>
  
  <p>I'm using Visual Studio Code (on OS X) and am looking into <a href="https://code.visualstudio.com/Docs/tasks" rel="noreferrer">its tasks</a> to run/compile the code snippets without having to switch to a terminal.</p>
  
  <p>For example, I found <a href="http://www.reddit.com/r/Python/comments/34yvcm/using_visual_studio_code_with_python/" rel="noreferrer">this following task</a> will run python on the currently open file.</p>
  
  <pre class="lang-json prettyprint-override"><code>// A task runner that runs a python program
  {
      "version": "0.1.0",
      "command": "/usr/bin/python",
      "args": ["${file}"]
  }
  </code></pre>
  
  <p>This task will use python as the task runner irrespective of the type of file I'm currently editing.</p>
  
  <p>How do I implement a task to run a command based on the file type (or select between multiple commands)? I.e. if I'm editing a C++ file, it will run clang++.</p>
  
  <ul>
  <li>If I can't do it based on file type; are there any alternatives to this?</li>
  <li>An alternative would be; are multiple commands supported?</li>
  </ul>