command :'profiles:list' do |c| c.syntax = 'ios profiles:list [development|distribution]' c.summary = 'Lists the Provisioning Profiles' c.description = '' c.action do |args, options| type = args.first.downcase.to_sym rescue nil profiles = agent.list_profiles(type ||= :development) say_warning "No #{type} provisioning profiles found." and abort if profiles.empty? table = Terminal::Table.new do |t| t << ["Profile", "App ID", "Status"] t.add_separator profiles.each do |profile| status = case profile.status when "Invalid" profile.status.red else profile.status.green end t << [profile.name, profile.app_id, status] end end puts table end end alias_command :profiles, :'profiles:list'