Class: GitlogMD::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlog-md/cli.rb

Constant Summary collapse

VERSION_STRING =
"
                          _________
                         {_________}
                          )=======(
                         /         \\
        GitlogMD        | _________ |
            %10s  ||   _     ||
                        ||  |_)    ||
                        ||  | \\/   ||
                  __    ||    /\\   ||
             __  (_|)   |'---------'|
            (_|)        `-.........-'
"

Instance Method Summary collapse

Constructor Details

#initializeCLI

Returns a new instance of CLI.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/gitlog-md/cli.rb', line 17

def initialize
  @arg_parser = GitlogMD::ArgumentParser.new
  @options = @arg_parser.parse
  @run = true

  if @options[:help]
    puts @arg_parser.usage
    @run = false
    return
  end
  if @options[:version]
    puts VERSION_STRING % GitlogMD::Version::STRING
    @run = false
    return
  end
end

Instance Method Details

#executeObject



34
35
36
37
38
# File 'lib/gitlog-md/cli.rb', line 34

def execute
  if @run
    GitlogMD::Parser.new.make_md(@options)
  end
end