Class: Agilib::Cli

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

Class Method Summary collapse

Class Method Details

.run(args, out = STDOUT) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/agilib/cli.rb', line 7

def self.run(args, out = STDOUT)

  OptionParser.new{ |opts|
    opts.banner = "Usage:\n    agilib [options] <location>"
    opts.separator "\nOptions: "

    opts.on_tail("-v", "--version", "Print version number") do
      require "agilib/version"
      out << "Agilib #{Agilib::VERSION}\n"
      exit
    end

    opts.on_tail("-h", "--help", "Print this help") do
      out << "Agilib Help.\n\n"
      out << opts
      out << "\nCreated and maintained by Agivis Web & Mobile, available under the MIT License.\n"
      exit
    end
  }.parse!(args)

end