1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

[Sass] [sass-convert] Properly set default formats.

This commit is contained in:
Nathan Weizenbaum 2010-02-21 18:21:38 -08:00
parent 731891b5c3
commit b97bde7a62

View file

@ -559,13 +559,15 @@ END
opts.on('-F', '--from FORMAT', opts.on('-F', '--from FORMAT',
'The format to convert from. Can be css, scss, or sass.', 'The format to convert from. Can be css, scss, or sass.',
'By default, this is inferred from the input filename.') do |name| 'By default, this is inferred from the input filename.',
'If there is none, defaults to css.') do |name|
@options[:from] = name.downcase.to_sym @options[:from] = name.downcase.to_sym
end end
opts.on('-T', '--to FORMAT', opts.on('-T', '--to FORMAT',
'The format to convert to. Can be scss or sass.', 'The format to convert to. Can be scss or sass.',
'By default, this is inferred from the output filename.') do |name| 'By default, this is inferred from the output filename.',
'If there is none, defaults to sass.') do |name|
@options[:to] = name.downcase.to_sym @options[:to] = name.downcase.to_sym
@options[:for_engine][:syntax] = @options[:to] @options[:for_engine][:syntax] = @options[:to]
end end
@ -607,6 +609,9 @@ END
end end
end end
@options[:from] ||= :css
@options[:to] ||= :sass
out = out =
if @options[:from] == :css if @options[:from] == :css
require 'sass/css' require 'sass/css'