Class: Bump::CLI

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

Overview

The command line interface

Constant Summary collapse

VERSION_FILE =

The bump info filename

'.bmp.yml'
CLI_NAME =

The cli name

'bmp'

Instance Method Summary collapse

Instance Method Details

#mainvoid

This method returns an undefined value.

The main routine



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/bump/cli.rb', line 20

def main

    opts = Slop.parse do |o|
        o.banner = "Usage: #{CLI_NAME} [-p|-m|-j] [-c]"

        o.bool '-i', '--info', 'show current version info'
        o.bool '-p', '--patch', 'bump patch (0.0.1) level'
        o.bool '-m', '--minor', 'bump minor (0.1.0) level'
        o.bool '-j', '--major', 'bump major (1.0.0) level'
        o.bool '-c', '--commit', 'commit bump changes (git required)'
        o.bool '-h', '--help', 'show this help and exit'
        o.bool '-v', '--version', 'show version and exit'
        o.string '-s', '--preid', 'set pre release version id (e.g. alpha, beta.1)'
    end

    app = Application.new opts.to_hash, opts.to_s, "#{CLI_NAME} v#{Bump::VERSION}", VERSION_FILE, Logger.new

    app.main

end