Revel命令列工具編譯使用

來源:互聯網
上載者:User
這是一個建立於 的文章,其中的資訊可能已經有所發展或是發生改變。

上一篇,簡單介紹了下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$

這個命令列工具代碼較少,如下:

下一篇,我們從代碼來詳細瞭解這個工具。

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.