问题
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 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?
Thanks in advance for your help!
Doug
回答1:
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.
来源:https://stackoverflow.com/questions/18244050/twistd-using-usage-options-in-a-tac-file