views:

129

answers:

1

Part of the generator I am writing isn't needed in all circumstances, so I need to add a switch so that I can specify whether it is run - something similar to the --skip_migration switch.

How should I go about implementing this?

+3  A: 

You want to implement your own options parser in your generator using the add_options! method available to all Rails generators (which is not as hard as it sounds).

Also when I trying to get this done in a generator referencing the generator for restful_authentication was very useful.

Peer Allan