require 'thor'
require 'thor/group'

module SpreeCmd
  class Command

    if ARGV.first == 'version'
      puts Gem.loaded_specs['spree_cmd'].version
    elsif ARGV.first == 'extension'
      ARGV.shift
      require 'spree_cmd/extension'
      SpreeCmd::Extension.start
    else
      ARGV.shift
      require 'spree_cmd/installer'
      SpreeCmd::Installer.start
    end
  end
end
require 'thor'
require 'thor/group'

module SpreeCmd
  class Command

    case ARGV.first
      when 'version' || '-v' || '--version'
        puts Gem.loaded_specs['spree_cmd'].version
      when 'extension'
        ARGV.shift
        require 'spree_cmd/extension'
        SpreeCmd::Extension.start
      else
        ARGV.shift
        require 'spree_cmd/installer'
        SpreeCmd::Installer.start
    end
  end
end

Allow -v or --version to get back the version
Allow -v or --version to get back the version
