Revel命令行工具编译使用
上一篇,简单介绍了下Revel,这一篇我们看下 github.com/robfig/revel/cmd 这个命令行工具。
文档:http://robfig.github.com/revel/manual/tool.html
首先,编译Revel命令行工具,如下:
go build -o bin/revel github.com/robfig/revel/cmd
接着运行帮助,如下:
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 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$
从帮助可以知道关于run,new,clean等这几个简单的命令的用途,而更多详细的介绍可以使用:revel help [command]获得。
如下:
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 in the given import path, taking the final element in
the path to be 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]
Clean 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]
Package the Revel web application named by the given import path.
This allows it to be 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 for 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 be used to determine logic in the application itself.
Run mode defaults to "dev".
yourihua@ubuntu:~/workplace/rhino/bin$
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。