Revel命令行工具编译使用

Rhino(犀牛) · · 3442 次点击 · · 开始浏览    
这是一个创建于 的文章,其中的信息可能已经有所发展或是发生改变。

上一篇,简单介绍了下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$

这个命令行工具代码较少,如下:
2013-01-06 23:12:11的屏幕截图
下一篇,我们从代码来详细了解这个工具。


有疑问加站长微信联系(非本文作者)

本文来自:Rhino 的博客

感谢作者:Rhino(犀牛)

查看原文:Revel命令行工具编译使用

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

3442 次点击  
加入收藏 微博
上一篇:Revel框架简介
下一篇:Go简单排序
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传