title: How can I pass arguments to the executable in nodemon (or node-supervisor)?
body: <p>node can be run with a debug parameter like this</p>
  
  <pre><code>$ node --debug src/file.js
  </code></pre>
  
  <p>I can also pass that parameter through the coffee-script binary like this</p>
  
  <pre><code>$ coffee --nodejs --debug src/file.coffee
  </code></pre>
  
  <p>Which works. But things get more difficult when I involve <a href="https://github.com/isaacs/node-supervisor" rel="noreferrer">supervisor</a>. Running coffee scripts is no problem:</p>
  
  <pre><code>$ supervisor -w src src/file.coffee
  </code></pre>
  
  <p>But I want to debug the coffee scripts that I'm running with <a href="https://github.com/isaacs/node-supervisor" rel="noreferrer">supervisor</a>. How can I send arguments such as <code>--debug</code> through <a href="https://github.com/isaacs/node-supervisor" rel="noreferrer">supervisor</a>? I tried setting the executable to a string with the arguments like this:</p>
  
  <pre><code>$ supervisor -w src -x "coffee --nodejs --debug" src/server.coffee
  </code></pre>
  
  <p>Which produced an infinitely repeating error message saying</p>
  
  <blockquote>
  <pre>
  DEBUG: Starting child process with 'coffee --nodejs --debug src/server.coffee'
  DEBUG: execvp(): No such file or directory
  </pre>
  </blockquote>
  
  <p>Which is odd, because running <code>coffee --nodejs --debug src/server.coffee</code> in the terminal works.</p>
  
  <p><strong>So how can I send arguments through <a href="https://github.com/isaacs/node-supervisor" rel="noreferrer">supervisor</a>?</strong></p>
  
  <hr>
  
  <p><strong><em>Edit:</em></strong> I want to expand my question with mentioning that I've now tried using <a href="https://github.com/remy/nodemon" rel="noreferrer">nodemon</a> as well. It seems <a href="https://github.com/remy/nodemon" rel="noreferrer">nodemon</a> is considered preferable to <a href="https://github.com/isaacs/node-supervisor" rel="noreferrer">node-supervisor</a>, so I'll accept any answer that explains how to pass <code>--debug</code> to the node process when launching coffee scripts through <a href="https://github.com/remy/nodemon" rel="noreferrer">nodemon</a></p>
  
  <hr>
  
  <p><strong><em>Edit:</em></strong> Here's the output from <a href="https://github.com/remy/nodemon" rel="noreferrer">nodemon</a>. Clearly the arguments are not passed in the same order :-(</p>
  
  <pre>
  $ nodemon -w src -x coffee --nodejs --debug src/server.coffee
  15 Jan 03:41:56 - [nodemon] v0.6.5
  15 Jan 03:41:56 - [nodemon] watching: /foo/bar/server/src
  15 Jan 03:41:56 - [nodemon] running --debug
  15 Jan 03:41:56 - [nodemon] starting `coffee --debug --nodejs src/server.coffee`
  
  node.js:201
          throw e; // process.nextTick error, or 'error' event on first tick
                ^
  
  Error: unrecognized option: --debug
  </pre>