Sha256: c51bf4550c2b8db09a35def42f2f69bbe569171bfdcc1c3dd5aa1366f02af9a9

Contents?: true

Size: 1 KB

Versions: 1

Compression:

Stored size: 1 KB

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true
require 'feedlrop'
require "simpleoptparse"
require 'yaml'

token, user_id, hash = Feedlrop::Cli.setup

banner = "Usage: bundle exec feedlrop --cmd=(lp|lpd|r)"
opts = {}
Simpleoptparse::Simpleoptparse.parse(ARGV, opts, banner, Arxutils_Sqlite3::VERSION, nil) do |parser|
  parser.on("--cmd X", %w[lp lpd r]) { |x| opts["cmd"] = x }
end

flop = Feedlrop::Feedlrop.new(
  token,
  hash
)

cmd = opts["cmd"]
# way = :REMOTE
# way = :LOCAL
# way = :LOCAL_PSTORE
# way = :LOCAL_PSTORE_AND_DB
# way = :REMOTE

 ERROR_CODE_INVALID_CMD = 100

case cmd
when "lp"
  # :LOCAL_PSTORE
  # puts "way=#{way}"
  # exit
  flop.check_backup
  # exit
when "lpd"
  # :LOCAL_PSTORE_AND_DB
  # puts "way=#{way}"
  # exit
  # flop.check_backup
  flop.csv_to_db
  # exit
when "r"
  # :REMOTE
  puts "cmd=#{cmd}"
  # exit
  flop.csv_open(hash['output_dir'])
  ret = flop.all_unread_count
  puts "all_unread_count=#{ret.size}"
  flop.csv_close
else
  puts "cmd=#{cmd}"
  exit ERROR_CODE_INVALID_CMD
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
feedlrop-0.1.24 exe/feedlrop