#!/usr/bin/env ruby lib = File.expand_path("#{File.dirname(__FILE__)}/../lib") $LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib) require "tailwind_sorter" warn_only = false config_file = TailwindSorter::Config::DEFAULT_CONFIG_FILE while (arg = ARGV.shift) case arg when "-w" warn_only = true when "-c" config_file = ARGV.shift else ARGV.unshift(arg) break end end begin while (file_name = ARGV.shift) TailwindSorter.sort_file(file_name, warn_only:, config_file:) end rescue ArgumentError => e warn e.message exit 1 end