class Thor
def find_task_possibilities(meth)
and determines whether it is an unambiguous prefix of a task or
this is the logic that takes the task name passed in by the user
def find_task_possibilities(meth) len = meth.to_s.length possibilities = all_tasks.merge(map).keys.select { |n| meth == n[0, len] }.sort unique_possibilities = possibilities.map { |k| map[k] || k }.uniq if possibilities.include?(meth) [meth] elsif unique_possibilities.size == 1 unique_possibilities else possibilities end end