lib/html2rss/cli.rb in html2rss-0.12.0 vs lib/html2rss/cli.rb in html2rss-0.13.0
- old
+ new
@@ -1,11 +1,16 @@
# frozen_string_literal: true
require_relative '../html2rss'
require 'thor'
+require 'addressable'
+##
+# The Html2rss namespace / command line interface.
module Html2rss
+ Log = Logger.new($stderr)
+
##
# The Html2rss command line interface.
class CLI < Thor
def self.exit_on_failure?
true
@@ -22,8 +27,13 @@
raise "File '#{yaml_file}' does not exist" unless File.exist?(yaml_file)
feed_name = options.shift
params = options.to_h { |opt| opt.split('=', 2) }
puts Html2rss.feed_from_yaml_config(yaml_file, feed_name, params:)
+ end
+
+ desc 'auto URL', 'automatically sources an RSS feed from the URL'
+ def auto(url)
+ puts Html2rss.auto_source(url)
end
end
end