Class: Basketcase::HelpCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/basketcase.rb

Instance Attribute Summary

Attributes inherited from Command

#comment, #listener, #targets

Instance Method Summary collapse

Methods inherited from Command

#accept_args, #effective_targets, #initialize, #option_comment, #option_graphical, #option_recurse, #report, #specified_targets

Methods included from Utils

#mkpath

Constructor Details

This class inherits a constructor from Basketcase::Command

Instance Method Details

#executeObject



288
289
290
291
292
293
294
295
296
297
298
299
300
# File 'lib/basketcase.rb', line 288

def execute
  if @targets.empty?
    puts @basketcase.usage
    exit
  end
  @targets.each do |command_name|
    command = make_command(command_name)
    puts
    puts "% basketcase #{command_name} #{command.synopsis}"
    puts
    puts command.help.gsub(/^/, "    ")
  end
end

#helpObject



284
285
286
# File 'lib/basketcase.rb', line 284

def help
  "Display usage instructions."
end

#synopsisObject



280
281
282
# File 'lib/basketcase.rb', line 280

def synopsis
  "[<command>]"
end