Files
news.gitea.happylizard.me/bin/gems/html-proofer-5.0.10/lib/html_proofer/cli.rb
T
pizza2d1 4cee170d66
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 9s
Add bin and edit workflow
2026-09-16 13:11:16 -06:00

29 lines
677 B
Ruby

# frozen_string_literal: true
module HTMLProofer
# The CLI is a class responsible of handling all the command line interface
# logic.
class CLI
attr_reader :options
def initialize
@options = {}
end
def run(args = ARGV)
@options, path = HTMLProofer::Configuration.new.parse_cli_options(args)
paths = path.split(",")
if @options[:as_links]
links = path.split(",").map(&:strip)
HTMLProofer.check_links(links, @options).run
elsif File.directory?(paths.first)
HTMLProofer.check_directories(paths, @options).run
else
HTMLProofer.check_file(path, @options).run
end
end
end
end