Refactor subcommands (ext.) #32

wants to merge 11 commits into


None yet
3 participants

ubolonton commented Jan 19, 2013

Extension of #30

Additional changes:

  • Moved commands into warp.command
  • Registered functions as commands by a decorator (not usable by apps yet, because there is currently no good way to load custom code before parsing command line options)
  • Fixed skeleton command not using "siteDir" option correctly ("twistd warp skeleton -d test" did not work, but "twistd warp -d test skeleton" did)

phunehehe referenced this pull request Jan 21, 2013


Refactor subcommands #30


brendonh commented Jan 23, 2013

This looks mostly pretty good, but why is the CmdOptions class defined inside the decorator?

Also, I'm not sure that generally-applicable options (like siteDir) should actually be replicated on each command. What was wrong with how it worked before?


ubolonton commented Feb 1, 2013

CmdOptions is defined inside the decorator so that it has access to the function's properties like name and argument list.

Yeah we shouldn't have these options replicated. The fix should have been removing that option from skeleton


ubolonton commented Jan 13, 2014

I have tested this against the latest master.
Please merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment