added option -n to generate resource