Class: Badge::CommandsGenerator

Inherits:
Object
  • Object
show all
Includes:
Commander::Methods
Defined in:
lib/badge/commands_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.startObject



10
11
12
# File 'lib/badge/commands_generator.rb', line 10

def self.start
  self.new.run
end

Instance Method Details

#runObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/badge/commands_generator.rb', line 14

def run
  program :version, Badge::VERSION
  program :description, 'Add a badge to your app icon'
  program :help, 'Author', 'Daniel Griesser <[email protected]>'
  program :help, 'Website', 'https://github.com/HazAT/badge'
  program :help, 'GitHub', 'https://github.com/HazAT/badge'
  program :help_formatter, :compact

  global_option('--verbose', 'Shows a more verbose output') { FastlaneCore::Globals.verbose = true }

  always_trace!

  FastlaneCore::CommanderGenerator.new.generate(Badge::Options.available_options)

  command :run do |c|
    c.syntax = 'badge'
    c.description = "Adds a badge to your app icon"

    c.action do |args, options|
      params = FastlaneCore::Configuration.create(Badge::Options.available_options, options.__hash__)
      Badge::Runner.new.run('.', params)
    end
  end

  default_command :run
  run!
end