2013-03-28 50 views
3

是否有針對單個rake任務的標準幫助命令?如何獲得有關特定rake任務的幫助?

rake -h顯示器進行耙的選項。

rake -D介紹耙任務。

rake mytask運行mytask。

是否有像rake -h mytask這樣的描述mytask,並列出其可選和/或必需的參數?

例如,下面的代碼將運行軌道單獨的測試:

rake test TEST=path_to_test 

如何發現TEST = path_to_test是一個可選的參數耙測試?

回答

1

-D接受的圖案。所以你可以使用它。

例子:

rake -D db 

rake -D db:migrate 
+0

謝謝,加用'耙-D test'格局似乎並沒有列出任何參數。它通過列舉兩個選項來工作,例如'rake -D db:migrate',但也許有另一種方法可用於這兩個示例? – user1385729 2013-03-28 05:41:39

4

命令rake -D test沒有我的系統上。相反,你可以使用

# list test command with details 
rake test -D 

# list all test tasks with description 
rake test -T 

# list all test tasks even without description(Recommened) 
rake test -T -A 
+0

它也適用,但爲什麼'rake -D test'是錯誤的?我看到它正在工作 – HungryCoder 2013-03-28 06:26:35

+0

我不知道爲什麼,但'rake -D test'在我的系統中不起作用,它不返回結果,而'rake test -D'完成了這項工作。 – 2013-03-28 06:28:34

+0

@HungryCoder,我修改了措辭。 – 2013-03-28 06:34:31