class Sass::Exec::SassConvert
def set_opts(opts)
-
opts
(OptionParser
) --
def set_opts(opts) opts.banner = <<END sass-convert [options] [INPUT] [OUTPUT] ption: erts between CSS, Sass, and SCSS files. converts from SCSS to Sass, onverts from CSS to SCSS (adding appropriate nesting). s: opts.on('-F', '--from FORMAT', 'The format to convert from. Can be css, scss, sass, less.', 'By default, this is inferred from the input filename.', 'If there is none, defaults to css.') do |name| @options[:from] = name.downcase.to_sym unless [:css, :scss, :sass, :less].include?(@options[:from]) raise "Unknown format for sass-convert --from: #{name}" end try_less_note if @options[:from] == :less end opts.on('-T', '--to FORMAT', 'The format to convert to. Can be scss or sass.', 'By default, this is inferred from the output filename.', 'If there is none, defaults to sass.') do |name| @options[:to] = name.downcase.to_sym unless [:scss, :sass].include?(@options[:to]) raise "Unknown format for sass-convert --to: #{name}" end end opts.on('-R', '--recursive', 'Convert all the files in a directory. Requires --from and --to.') do @options[:recursive] = true end opts.on('-i', '--in-place', 'Convert a file to its own syntax.', 'This can be used to update some deprecated syntax.') do @options[:in_place] = true end opts.on('--dasherize', 'Convert underscores to dashes') do @options[:for_tree][:dasherize] = true end opts.on('--indent NUM', 'How many spaces to use for each level of indentation. Defaults to 2.', '"t" means use hard tabs.') do |indent| if indent == 't' @options[:for_tree][:indent] = "\t" else @options[:for_tree][:indent] = " " * indent.to_i end end opts.on('--old', 'Output the old-style ":prop val" property syntax.', 'Only meaningful when generating Sass.') do @options[:for_tree][:old] = true end opts.on('-C', '--no-cache', "Don't cache to sassc files.") do @options[:for_engine][:read_cache] = false end unless ::Sass::Util.ruby1_8? opts.on('-E encoding', 'Specify the default encoding for Sass and CSS files.') do |encoding| Encoding.default_external = encoding end end super end