public
Description: go (to project) do (stuffs)
Homepage: http://rubymatt.rubyforge.org/godo
Clone URL: git://github.com/mmower/godo.git
add --list-types option to show available project types
lmarlow (author)
Wed May 28 14:17:18 -0700 2008
commit  4ee7d3cb908e0111ac126e983bd6b1fc3700364a
tree    a6b5e725220cb57143ba7b58f63a0b1064e9c107
parent  15cb6ef2d7638ae96b323024e3c83998df36532f
...
1
2
3
4
 
 
5
6
7
...
69
70
71
 
 
 
 
72
73
74
...
1
2
 
 
3
4
5
6
7
...
69
70
71
72
73
74
75
76
77
78
0
@@ -1,7 +1,7 @@
0
 = godo
0
 
0
-* version: 1.0.7
0
-* released: 2008-05-21
0
+* version: 1.0.8
0
+* released: 2008-05-28
0
 * http://simplyruby.rubyforge.org/godo
0
 
0
 == DESCRIPTION:
0
@@ -69,6 +69,10 @@ a project level .godo file):
0
 
0
 godo -o <matcher> <project>
0
 
0
+To see what project types are available:
0
+
0
+godo --list-types
0
+
0
 == REQUIREMENTS:
0
 
0
 * Trollop
...
10
11
12
 
13
14
15
...
10
11
12
13
14
15
16
0
@@ -10,6 +10,7 @@ Ick.sugarize
0
 opts = Trollop::options do
0
   opt :install, "Create a fresh ~/.godo configuration file"
0
   opt :override, "Override heuristics to specify project type", :short => 'o', :type => :string
0
+ opt :list_types, "List available project types", :short => 'l'
0
 end
0
 
0
 if opts[:install]
...
1
2
3
4
 
5
6
7
...
35
36
37
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
39
40
...
1
2
3
 
4
5
6
7
...
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
0
@@ -1,7 +1,7 @@
0
 require 'yaml'
0
 
0
 module Godo
0
- VERSION = '1.0.7'
0
+ VERSION = '1.0.8'
0
   LIBPATH = File.expand_path( File.dirname( __FILE__ ) )
0
   
0
   # When called with no arguments this will return the path to the gem
0
@@ -35,6 +35,20 @@ module Godo
0
   # project and invoke the appropriate actions.
0
   def self.godo( query, options )
0
     config = YAML::load( File.read( File.expand_path( "~/.godo" ) ) )
0
+
0
+ if options[:list_types]
0
+ matchers = config["matchers"]
0
+ if matchers && !matchers.empty?
0
+ puts "Available project types:"
0
+ config["matchers"].each do |matcher|
0
+ puts " - #{matcher['name']}"
0
+ end
0
+ else
0
+ puts "No available matchers found, please check your ~/.godo file"
0
+ end
0
+ return
0
+ end
0
+
0
     require 'finder'
0
     paths = Finder.find( query, config )
0
     found_path = if paths.empty?

Comments

    No one has commented yet.