Sha256: f3b5c4909eef4dde36722ba9884ea6a068fdf95bdc18f9bbd0ed111f149d4037

Contents?: true

Size: 1.43 KB

Versions: 2

Compression:

Stored size: 1.43 KB

Contents

#!/usr/bin/env ruby
$: << File.expand_path('../lib', File.dirname(__FILE__)) ##Delete before checkin
require 'facebook_google_calendar_sync/cli'
require 'facebook_google_calendar_sync'
require 'optparse'
require 'ostruct'

options = {}.merge(FacebookGoogleCalendarSync::DEFAULT_CONFIG)

OptionParser.new do |opts|
  opts.banner = "Usage: facebook-google-calendar-sync [options]"

  opts.on("-f", "--facebook-calendar-url URL", "Mandatory. Your Facebook iCalendar URL. eg. \"http://www.facebook.com/ical/u.php?uid=12345&key=67890\" Put the URL in quotes or you may find your process will be backgrounded because of the ampersand.") do | url |
    options[:facebook_calendar_url] = url
  end

  c_help = "Optional. The location of your Google API YAML file. Defaults to #{options[:google_api_config_file]}"
  opts.on("-c", "--google-api-config-file CONFIG", c_help) do | file |
    options[:google_api_config_file] = file
  end

  g_help = "Optional. Google calendar name, defaults to '#{options[:google_calendar_name]}'. This calendar will be created if it does not already exist."
  opts.on("-n", "--google-calendar-name NAME", g_help) do | name |
    options[:google_calendar_name] = name
  end

  v_help = "Verbose logging"
  opts.on("-v", "--verbose", v_help) do | verbose |
    options[:log_level] = :debug
  end


  opts.on( '-h', '--help', 'Display this screen' ) do
    puts opts
    exit
  end

end.parse!

FacebookGoogleCalendarSync::CLI.start options

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
facebook-google-calendar-sync-0.2.2 bin/facebook-google-calendar-sync
facebook-google-calendar-sync-0.2.1 bin/facebook-google-calendar-sync