Class: ApkUnpack

Inherits:
Object
  • Object
show all
Defined in:
lib/apk_unpack.rb

Overview

This class is responsible for CLI output and options

Class Method Summary collapse

Class Method Details

.runObject

This method defines the CLI options of the gem and takes in the YAML configuration file



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/apk_unpack.rb', line 10

def self.run 
  options = {}
  OptionParser.new do |opts|
      opts.banner = "Usage: example.rb [options]"
      
      opts.on("-c", "--config [Config File]", "Configuration file in YAML format") do |c|
        options[:config_file] = c
      end

    opts.on("-h", "--help", "Displays help information") do
        puts opts 
        exit
      end
  end.parse!
  if !options.empty?
     Parsing.parse(options[:config_file])
  else
      Decompiler.run
  end
end