# Rake default == -T

**URL:** <https://www.ruby-forum.com/t/rake-default-t/94270>\
**Category:** Ruby\
**Created:** [April 27, 2006, 1:18pm UTC](https://www.ruby-forum.com/t/rake-default-t/94270 "2006-04-27T13:18:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 27, 2006, 1:18pm UTC](https://www.ruby-forum.com/t/rake-default-t/94270/1 "2006-04-27T13:18:31Z")

</div>

Hi,

Is it possible to make the default task the same as using the -T  
option? I.e. I want to type:

% rake

And see all the tasks.

T.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 27, 2006, 2:26pm UTC](https://www.ruby-forum.com/t/rake-default-t/94270/2 "2006-04-27T14:26:19Z")

</div>

James Edward G. II \<james [grayproductions.net](http://grayproductions.net)\> writes:

> > And see all the tasks.
> 
> I assume you could make a task that shells out to rake -T.

Thanks, James. Turns out that doesn’t work so well. But your suggestion  
spark an  
idea and I and figured out a way:

task :default =\> [:tasks]

task :tasks do  
Rake.application.display\_tasks\_and\_comments  
end

T.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 27, 2006, 1:54pm UTC](https://www.ruby-forum.com/t/rake-default-t/94270/3 "2006-04-27T13:54:28Z")

</div>

On Apr 27, 2006, at 6:17 AM, TRANS wrote:

> Hi,
> 
> Is it possible to make the default task the same as using the -T  
> option? I.e. I want to type:
> 
> % rake
> 
> And see all the tasks.

I assume you could make a task that shells out to rake -T.

James Edward G. II

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 27, 2006, 3:04pm UTC](https://www.ruby-forum.com/t/rake-default-t/94270/4 "2006-04-27T15:04:45Z")

</div>

Trans wrote:

> task :default =\> [:tasks]
> 
> task :tasks do  
> Rake.application.display\_tasks\_and\_comments  
> end

This doesn’t work for me, viz,

$ rake  
(in /Users/kleb)  
$

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 27, 2006, 3:06pm UTC](https://www.ruby-forum.com/t/rake-default-t/94270/5 "2006-04-27T15:06:32Z")

</div>

Apparently, with rake 0.7.1 you also need to set the regexp filtering  
the tasks:

task :tasks do  
Rake.application.options.show\_task\_pattern = //  
Rake.application.display\_tasks\_and\_comments  
end

Ciao  
Stefano

On 27/04/06, Trans [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:  
[…]

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 27, 2006, 6:16pm UTC](https://www.ruby-forum.com/t/rake-default-t/94270/6 "2006-04-27T18:16:49Z")

</div>

Stefano T. wrote:

> Apparently, with rake 0.7.1 you also need to set the regexp filtering the tasks:
> 
> task :tasks do  
> Rake.application.options.show\_task\_pattern = //  
> Rake.application.display\_tasks\_and\_comments  
> end

Works for me now.

Thanks,
