module Rufo::Command
def self.format_args(args, want_check)
def self.format_args(args, want_check) files = [] args.each do |arg| if Dir.exist?(arg) files.concat Dir["#{arg}/**/*.rb"] elsif File.exist?(arg) files << arg else STDERR.puts "Error: file or directory not found: #{arg}" end end changed = false files.each do |file| success = format_file file, want_check changed ||= success end exit 1 if changed end