Module: Compass::Commands::SpriteOptionsParser

Defined in:
lib/compass/commands/sprite.rb

Instance Method Summary collapse

Instance Method Details

#set_options(opts) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/compass/commands/sprite.rb', line 7

def set_options(opts)
  opts.on("-f SPRITE_FILE") do |output_file|
    self.options[:output_file] = output_file
  end
  opts.on("--skip-overrides", "Skip the generation of sprite overrides") do |skip_overrides|
    self.options[:skip_overrides] = skip_overrides
  end
  opts.banner = %Q{
    Usage: compass sprite [options] "images/path/to/sprites/*.png"

    Description:
      Generate a sprite import based on the given sprite directory.
      Alternatively, you can simply do this in your sass files:

          @import "sprite-folder/*.png"

      And a magical, custom made sprite file will be imported.

    Options:
  }.strip.split("\n").map{|l| l.gsub(/^ {0,10}/,'')}.join("\n")

  super
end