# File lib/drydock.rb, line 175
175:     def call  
176:       self.print_header if self.respond_to? :print_header
177:       
178:       # Execute the command block if it exists
179:       if @b 
180:         run_validation
181:         @b.call(self) 
182:       
183:       # Otherwise check to see if an action was specified
184:       elsif !(chosen = find_action(self.option)).empty?
185:         raise "Only one action at a time please! I can't #{chosen.join(' AND ')}." if chosen.size > 1
186:         criteria = [[@cmd, chosen.first], [chosen.first, @cmd]]
187:         meth = name = nil
188:         # Try command_action, then action_command
189:         criteria.each do |tuple|
190:           name = tuple.join('_')
191:           meth = name if self.respond_to?(name)  
192:         end
193:         
194:         raise "#{self.class} needs a #{name} method!" unless meth
195:         
196:         run_validation(meth)
197:         self.send(meth)
198:         
199:       # No block and no action. We'll try for the method name in the Drydock::Command class. 
200:       elsif self.respond_to? @cmd.to_sym
201:         run_validation(@cmd)
202:         self.send(@cmd)
203:         
204:       # Well, then I have no idea what you want me to do!
205:       else
206:         raise "The command #{@alias} has no block and #{self.class} has no #{@cmd} method!"
207:       end
208:       
209:       self.print_footer if respond_to? :print_footer
210:     end