class Warp::Dir::Command::Help

Constants

EXAMPLES
INSTALLATION
USAGE

Public Instance Methods

commands_needing_points(commander, needing_point: true) click to toggle source
# File lib/warp/dir/command/help.rb, line 27
def commands_needing_points(commander,
                            needing_point: true)
  help = ''
  commander.
    commands.
    select{|cmd| needing_point ? cmd.needs_a_point? : !cmd.needs_a_point? }.
    map(&:command_name).each do |installed_commands|
    help << sprintf("  %s\n", commander.find(installed_commands).help)
  end
  help
end
run(opts, flags = []) click to toggle source
# File lib/warp/dir/command/help.rb, line 8
def run(opts, flags = [])
  commander = ::Warp::Dir.commander
  cmd = self
  on :success do
    message USAGE
    message ' '
    message 'Warp Point Commands:'.bold.green
    message ' '
    message cmd.commands_needing_points(commander, needing_point: true)
    message ' '
    message 'Global Commands:'.bold.green
    message ' '
    message cmd.commands_needing_points(commander, needing_point: false)
    message EXAMPLES
    message INSTALLATION
    message opts.to_s
  end
end