-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[New Feature] Added New Command-line Utility #33
Conversation
I like this a lot, but I wonder if there is a more flexible way to allow code generation in the revel cmd tool? Perhaps we will add this for now and brainstorm further... @revel/core thoughts? |
Do you mean something that can generate code for models and other kinds of files instead of just controllers? That could definitely be useful. |
@caneroj1 sorry for the long delay in response. Would you be able to help @revel/core by creating a step by step guide on how to use this new command? I'm sure we could figure it out on our own, but we have a lot to do already and your help would be greatly appreciated! |
} | ||
|
||
func checkApplicationPath() { | ||
fmt.Printf("Adding controller: %s.go\n", controller) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a bit misleading. It claims to be adding a controller but in fact is checking the application path.
The basic approach for templating should still work if the conflicts are solved. But IMHO it doesn't give us much. Creating one file and one directory isn't that big of a task. What else should it do in order to be more useful? Routes? |
Thats probably what wew all after +1 On 6 June 2016 at 15:22, Paul Tötterman notifications@github.com wrote:
|
@ptman Thank you for time and PR review. So what I understand is, we take this PR as inspirational to come up with |
In-favour of #48 I'm cloning this one. |
Added a new command-line feature to Revel called "add."
The command makes it easy to automatically create new controllers for your app, as it is instantiates them from a template file, and it also creates the views directory for that controller.
The command looks like
revel add [app_name] [controller_name]
.For example, given a Revel application called testapp,
revel add testapp user
would create a new controller called user.go under /controllers and the User directory under /views.