#!/usr/bin/env ruby

require 'fus'
require 'thor'

class FusRunner < Thor
  package_name "FUS"
  class_option :path, aliases: "-p", desc: "path in which to search (defaults to #{Dir.pwd})", banner: "path"
  
  default_task :find
  desc "find", "Find unused swift classes"
  def find
    finder = Fus::Finder.new(path)
    puts finder.unused_classnames
  end
  
  desc "list", "List all swift classes"
  def list
    finder = Fus::Finder.new(path)
    puts finder.swift_classnames
  end
 
  def help
    say("\nFind Unused Swift Classes\n\n")
    super
  end
 
  private 
  def path
    options[:path] || Dir.pwd
  end
end

FusRunner.start(ARGV)
