module MessengerPigeon::CLI

Helper for runs from the command line

Public Instance Methods

parse_options() click to toggle source
# File lib/messenger_pigeon/cli.rb, line 6
def parse_options
  options = {
    config: File.expand_path(ENV['MESSENGER_PIGEON_RC'] ||
                             '~/.messenger-pigeon.rc')
  }
  OptionParser.new do |opts|
    opts.banner = "Usage: messenger-pigeon [options] [pigeons]"
    opts.on('-c', '--config file', 'Configuration file') do |f|
      options[:config] = f
    end
  end.parse!
  options
end