Module: Compass::Commands::CreateProjectOptionsParser

Defined in:
lib/compass/commands/create_project.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/compass/commands/create_project.rb', line 7

def set_options(opts)

  if $command == "create"
    opts.banner = %Q{
      Usage: compass create path/to/project [options]

      Description:
      Create a new compass project at the path specified.

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

    opts.on_tail("--bare", "Don't generate any Sass or CSS files.") do
      self.options[:bare] = true
    end
  else
    opts.banner = %Q{
      Usage: compass init project_type path/to/project [options]

      Description:
      Initialize an existing project at the path specified.

      Supported Project Types:
      * rails

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

  opts.on("--using PATTERN", "A framework's pattern to use when creating the project.") do |framework|
    framework = framework.split('/', 2)
    self.options[:framework] = framework[0]
    self.options[:pattern] = framework[1]
  end

  opts.on("-x", "--syntax SYNTAX", [:sass, :scss], "Specify the syntax to use when generating stylesheets.", "One of sass or scss. Defaults to scss.") do |syntax|
    self.options[:preferred_syntax] = syntax
  end

  opts.on("--prepare", "Prepare the project by only creating configuration files.") do
    self.options[:prepare] = true
  end

  super

end