Sha256: c4cb05037cff3b8cb10159ce81d43deb7b24dee6f2409b15f0d4f5e0cdeaad4e

Contents?: true

Size: 1.16 KB

Versions: 1

Compression:

Stored size: 1.16 KB

Contents

#!/usr/bin/env ruby

# Enables UTF-8 compatibility in ruby 1.8.
$KCODE = 'u' if RUBY_VERSION < '1.9'

$LOAD_PATH.unshift(File.expand_path("../../lib", __FILE__))

require "hex_token_bot"
require 'optparse'
require 'irb'
require 'yaml'
require 'rubygems'

options = {}
option_parser = OptionParser.new do |opts|
  opts.banner = 'here is help messages of the command line tool.'

  opts.on('-v', '--version', 'Prints the version') do
    puts HexTokenBot::VERSION
    exit
  end

  opts.on('-c FILE_PATH', '--config FILE_PATH', 'Pass-in config path') do |value|
    options[:config_file_path] = value
  end

end.parse!

puts options.inspect

if options[:config_file_path]
  HexTokenBot.bots_yml = {
      :file_bots => File.join(options[:config_file_path], 'bots.yml'),
      :file_data_channels => File.join(options[:config_file_path], 'data_channels.yml'),
      :file_tran_channels => File.join(options[:config_file_path], 'tran_channels.yml'),
      :file_tran_users => File.join(options[:config_file_path], 'tran_users.yml')
  }
else
  $stderr.puts("To specify a custom config file use `hex_token_bot -c path/to/config_path`.")
  exit
end

cli = HexTokenBot::BotServer.new
cli.run!

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hex_token_bot-0.1.0 exe/hex_token_bot