This is a creation in Article, where the information may have evolved or changed.
On an article, briefly introduced the next Revel, this one we look at Github.com/robfig/revel/cmd this command line tool.
Document: Http://robfig.github.com/revel/manual/tool.html
First, compile the Revel command-line tool, as follows:
Go build-o bin/revel github.com/robfig/revel/cmd
Then run the help as follows:
yourihua@ubuntu:~/workplace/rhino/bin$ Revel Help
~
~ revel! Http://robfig.github.com/revel
~
Usage:revel command [arguments]
The commands are:
Run Run a Revel application
New Create a Skeleton Revel application
Clean Clean a Revel application ' s temp files
Package a Revel application (e.g. for deployment)
Test run all tests from the command-line
Use ' Revel Help [command] ' for more information.
yourihua@ubuntu:~/workplace/rhino/bin$
From the help you can know about the use of these simple commands such as Run,new,clean, and more detailed introductions can be obtained using: Revel Helper [command].
As follows:
yourihua@ubuntu:~/workplace/rhino/bin$ Revel Help New
~
~ revel! Http://robfig.github.com/revel
~
Usage:revel new [path]
New creates a few files to get a new Revel application running quickly.
It puts all of the files on the given import path, taking the final element in
The path to is the app name.
For example:
Revel New Import/path/helloworld
yourihua@ubuntu:~/workplace/rhino/bin$ Revel Help Clean
~
~ revel! Http://robfig.github.com/revel
~
Usage:revel clean [Import path]
The Revel Web application named by the given import path.
For example:
Revel Clean Github.com/robfig/revel/samples/chat
It removes the app/tmp directory.
yourihua@ubuntu:~/workplace/rhino/bin$ Revel Help Package
~
~ revel! Http://robfig.github.com/revel
~
Usage:revel package [Import path]
The Revel Web application named by the given import path.
This allows is deployed and run on a machine, that lacks a Go installation.
For example:
Revel Package Github.com/robfig/revel/samples/chat
yourihua@ubuntu:~/workplace/rhino/bin$ Revel Help Test
~
~ revel! Http://robfig.github.com/revel
~
Usage:revel test [Import path] [run mode]
Run all tests to the Revel app named by the given import path.
For example, to run the booking sample application ' s tests:
Revel Test Github.com/robfig/revel/samples/booking Dev
The run mode is used to select which set of app.conf configuration should
Apply and May is used to determine logic in the application itself.
Run mode defaults to "Dev".
yourihua@ubuntu:~/workplace/rhino/bin$
This command-line tool has fewer code, as follows:
Next, we'll learn more about this tool from the code.