#!/usr/bin/env ruby require 'less' # This file is inspired by / based off of http://ozmm.org/posts/argf.html def help puts <<-help Usage: $ lessc < style.less $ lessc file1.less file2.less help end if ($stdin.tty? && ARGV.empty?) || ARGV.delete('-h') || ARGV.delete('--help') help else doc = ARGF.read parser = Less::Parser.new tree = parser.parse(doc) puts tree.to_css(compress: true) end