title: twisted's twistd tool parsing command line parameters
body: <p>I've got a simple .tac file with a simple service, I start it with:</p>
  
  <pre><code>twistd -y service.tac
  </code></pre>
  
  <p>and everything works fine. But inside the tac file I've got a hardcoded port for my service and I would like to make it dynamic. The most desired way I want to have it working is via standard unix command line arguments:</p>
  
  <pre><code>twistd -y service.tac --port 8081
  </code></pre>
  
  <p>and then I'd like to access the <code>port</code> variable somewhere inside the .tac file. Just like standard python modules: optparse and argparse. I was looking for such solution in Twisted, I found only <a href="https://twistedmatrix.com/documents/12.0.0/core/howto/options.html#auto6" rel="nofollow">https://twistedmatrix.com/documents/12.0.0/core/howto/options.html#auto6</a> which, I'm afraid, is not what I need, since I get this error:</p>
  
  <pre><code>$ twistd -y service.tac 
  /usr/bin/twistd: option -y not recognized
  /usr/bin/twistd: Try --help for usage details.
  </code></pre>
  
  <p>Does anyone know how to parametrize <code>twistd</code> tool?</p>