pilot/lib/pilot/commands_generator.rb in fastlane-2.18.0.beta.20170217010035 vs pilot/lib/pilot/commands_generator.rb in fastlane-2.18.0.beta.20170218010103

- old
+ new

@@ -6,12 +6,10 @@ module Pilot class CommandsGenerator include Commander::Methods - FastlaneCore::CommanderGenerator.new.generate(Pilot::Options.available_options) - def self.start new.run end def convert_options(options) @@ -51,78 +49,105 @@ global_option("--verbose") { FastlaneCore::Globals.verbose = true } command :upload do |c| c.syntax = "fastlane pilot upload" c.description = "Uploads a new binary to Apple TestFlight" + + FastlaneCore::CommanderGenerator.new.generate(Pilot::Options.available_options, command: c) + c.action do |args, options| config = FastlaneCore::Configuration.create(Pilot::Options.available_options, convert_options(options)) Pilot::BuildManager.new.upload(config) end end command :distribute do |c| c.syntax = "fastlane pilot distribute" c.description = "Distribute a previously uploaded binary to Apple TestFlight" + + FastlaneCore::CommanderGenerator.new.generate(Pilot::Options.available_options, command: c) + c.action do |args, options| config = FastlaneCore::Configuration.create(Pilot::Options.available_options, convert_options(options)) Pilot::BuildManager.new.distribute(config) end end command :builds do |c| c.syntax = "fastlane pilot builds" c.description = "Lists all builds for given application" + + FastlaneCore::CommanderGenerator.new.generate(Pilot::Options.available_options, command: c) + c.action do |args, options| config = FastlaneCore::Configuration.create(Pilot::Options.available_options, convert_options(options)) Pilot::BuildManager.new.list(config) end end command :add do |c| c.syntax = "fastlane pilot add" c.description = "Adds new external tester(s) to a specific app (if given). This will also add an existing tester to an app." + + FastlaneCore::CommanderGenerator.new.generate(Pilot::Options.available_options, command: c) + c.action do |args, options| handle_multiple('add_tester', args, options) end end command :list do |c| c.syntax = "fastlane pilot list" c.description = "Lists all registered testers, both internal and external" + + FastlaneCore::CommanderGenerator.new.generate(Pilot::Options.available_options, command: c) + c.action do |args, options| config = FastlaneCore::Configuration.create(Pilot::Options.available_options, convert_options(options)) Pilot::TesterManager.new.list_testers(config) end end command :find do |c| c.syntax = "fastlane pilot find" c.description = "Find tester(s) (internal or external) by their email address" + + FastlaneCore::CommanderGenerator.new.generate(Pilot::Options.available_options, command: c) + c.action do |args, options| handle_multiple('find_tester', args, options) end end command :remove do |c| c.syntax = "fastlane pilot remove" c.description = "Remove external tester(s) by their email address" + + FastlaneCore::CommanderGenerator.new.generate(Pilot::Options.available_options, command: c) + c.action do |args, options| handle_multiple('remove_tester', args, options) end end command :export do |c| c.syntax = "fastlane pilot export" c.description = "Exports all external testers to a CSV file" + + FastlaneCore::CommanderGenerator.new.generate(Pilot::Options.available_options, command: c) + c.action do |args, options| config = FastlaneCore::Configuration.create(Pilot::Options.available_options, convert_options(options)) Pilot::TesterExporter.new.export_testers(config) end end command :import do |c| c.syntax = "fastlane pilot import" c.description = "Create external testers from a CSV file" + + FastlaneCore::CommanderGenerator.new.generate(Pilot::Options.available_options, command: c) + c.action do |args, options| config = FastlaneCore::Configuration.create(Pilot::Options.available_options, convert_options(options)) Pilot::TesterImporter.new.import_testers(config) end end