Skip to content
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

Closed
wants to merge 4 commits into from

Conversation

caneroj1
Copy link

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.

@caneroj1 caneroj1 changed the title Added New Command-line Feature [Feature Request] Added New Command-line Utility Aug 29, 2015
@caneroj1 caneroj1 changed the title [Feature Request] Added New Command-line Utility [New Feature] Added New Command-line Utility Aug 29, 2015
@brendensoares brendensoares self-assigned this Sep 26, 2015
@brendensoares
Copy link
Member

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?

@caneroj1
Copy link
Author

Do you mean something that can generate code for models and other kinds of files instead of just controllers? That could definitely be useful.

@brendensoares
Copy link
Member

@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)
Copy link
Contributor

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.

@ptman
Copy link
Contributor

ptman commented Jun 6, 2016

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?

@pedromorgan
Copy link
Member

Thats probably what wew all after +1

On 6 June 2016 at 15:22, Paul Tötterman notifications@github.com wrote:

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?


You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub
#33 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AAHkHFApEAVcVYvYWb_Kzh4EZunpmZ0cks5qJC0ZgaJpZM4Fwgdm
.

@jeevatkm
Copy link
Contributor

jeevatkm commented Jun 7, 2016

@ptman Thank you for time and PR review.

So what I understand is, we take this PR as inspirational to come up with create or generate command in future with controller, routes creation etc.

@jeevatkm
Copy link
Contributor

jeevatkm commented Jun 8, 2016

In-favour of #48 I'm cloning this one.

@jeevatkm jeevatkm closed this Jun 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants