module Evernote2org::Cli

Public Class Methods

build_options!() click to toggle source
# File lib/evernote2org/cli.rb, line 15
def build_options!
  options = {}
  OptionParser.new do |opts|
    opts.banner = "Usage: evernote2org -f [.enex file] -o [output.org]"

    opts.on("-fFILE", "--file=FILE", "input .enex file") do |f|
      options[:input] = f
    end

    opts.on("-oOUT", "--out=OUT", "output directory") do |o|
      options[:output] = o
    end
  end.parse!

  options
end
start() click to toggle source
# File lib/evernote2org/cli.rb, line 8
def start
  options = build_options!
  enex = Enex.parse(options[:input])
  FileUtils.mkdir_p(options[:output])
  enex.export_to(options[:output])
end