lib/subcommand.rb
##
# specify a single command and all its options
# If multiple names are given, they are treated as aliases.
# Do repeatedly for each command
# Yields the optionparser
specify a single command and all its options
If multiple names are given, they are treated as aliases.
Do repeatedly for each command
Yields the optionparser
specify a single command and all its options If multiple names are given they are treated as aliases . Do repeatedly for each command Yields the optionparser
def print_actions
    cmdtext = "Commands are:"
    @commands.each_pair do |c, opt| 
      desc = opt.call.description
      cmdtext << "\n   #{c} : #{desc}"
    end
    unless @aliases.empty?
      cmdtext << "\n\nAliases: \n" 
      @aliases.each_pair { |name, val| cmdtext << "   #{name} - #{val}\n"  }
    end
    cmdtext << "\n\nSee '#{$0} help COMMAND' for more information on a specific command."
  end
def print_actions cmdtext = "Commands are:" @commands . each_pair do | c , opt | desc = opt . call . description cmdtext << "\n   #{c} : #{desc}" end unless @aliases . empty? cmdtext << "\n\nAliases: \n" @aliases . each_pair { | name , val | cmdtext << "   #{name} - #{val}\n" } end cmdtext << "\n\nSee '#{$0} help COMMAND' for more information on a specific command." end
specify a single command and all its options
If multiple names are given, they are treated as aliases.
specify a single command and all its options If multiple names are given they are treated as aliases .
#puts "inside opt.call loop" # print aliases