module Thor::Base::ClassMethods

Protected Instance Methods

find_suggestion(task) click to toggle source

Finds a correct command with the shortest edit distance from task.

# File lib/thor/levenshtein.rb, line 23
def find_suggestion(task)
  all_tasks.keys.min_by { |key| ::Levenshtein.distance task, key }
end