twistd using usage.options in a *.tac file

arguments, command, python, twisted

Solution

A tac file is configuration. It doesn't accept configuration.

If you want to pass command line arguments, you do need to write a plugin.

Problem

I'm writing a server with Twisted that is based on a `*.tac` file that starts the services and the application. I'd like to get one additional command line argument to specify a yaml configuration file. I've tried using usage.Options by building a class that inherits from it, but is choking because of the additional, twistd command line arguments (`-y <filename>` for example) not being specified in my class Options(...) class. How can get one additional argument and still pass the rest to twistd? Do I have to do this using the plugin system?

Original source