# File lib/juicer/command/merge.rb, line 15
      def initialize(log = nil)
        super('merge', false, true)
        @types = { :js => Juicer::Merger::JavaScriptMerger,
                   :css => Juicer::Merger::StylesheetMerger }
        @output = nil                   # File to write to
        @force = false                  # Overwrite existing file if true
        @type = nil                     # "css" or "js" - for minifyer
        @minifyer = "yui_compressor"    # Which minifyer to use
        @opts = {}                      # Path to minifyer binary
        @arguments = nil                # Minifyer arguments
        @ignore = false                 # Ignore syntax problems if true
        @cache_buster = :soft           # What kind of cache buster to use, :soft or :hard
        @hosts = nil                    # Hosts to use when replacing URLs in stylesheets
        @document_root = nil                 # Used to understand absolute paths
        @relative_urls = false          # Make the merger use relative URLs
        @absolute_urls = false          # Make the merger use absolute URLs
        @local_hosts = []               # Host names that are served from :document_root
        @verify = true                  # Verify js files with JsLint
        @image_embed_type = :none       # Embed images in css files, options are :none, :data_uri
        @force_image_embed = false

        @log = log || Logger.new(STDOUT)

        self.short_desc = "Combines and minifies CSS and JavaScript files"
        self.description = "Each file provided as input will be checked for dependencies to other files,\nand those files will be added to the final output\n\nFor CSS files the dependency checking is done through regular @import\nstatements.\n\nFor JavaScript files you can tell Juicer about dependencies through special\ncomment switches. These should appear inside a multi-line comment, specifically\ninside the first multi-line comment. The switch is @depend or @depends, your\nchoice.\n\nThe -m --minifyer switch can be used to select which minifyer to use. Currently\nonly YUI Compressor and Google Closure Compiler is supported, ie -m yui_compressor (default) or -m closure_compiler. When using\nthe compressor the path should be the path to where the jar file is found.\n"

        self.options = CmdParse::OptionParserWrapper.new do |opt|
          opt.on("-o", "--output file", "Output filename") { |filename| @output = filename }
          opt.on("-p", "--path path", "Path to compressor binary") { |path| @opts[:bin_path] = path }
          opt.on("-m", "--minifyer name", "Which minifer to use. Currently only supports yui_compressor and closure compiler") { |name| @minifyer = name }
          opt.on("-f", "--force", "Force overwrite of target file") { @force = true }
          opt.on("-a", "--arguments arguments", "Arguments to minifyer, escape with quotes") { |arguments|
            @arguments = arguments.to_s.gsub(/(^['"]|["']$)/, "")
          }
          opt.on("-i", "--ignore-problems", "Merge and minify even if verifyer finds problems") { @ignore = true }
          opt.on("-s", "--skip-verification", "Skip JsLint verification (js files only). Not recomended!") { @verify = false }
          opt.on("-t", "--type type", "Juicer can only guess type when files have .css or .js extensions. Specify js or\n" +
                           (" " * 37) + "css with this option in cases where files have other extensions.") { |type| @type = type.to_sym }
          opt.on("-h", "--hosts hosts", "Cycle asset hosts for referenced urls. Comma separated") { |hosts| @hosts = hosts.split(",") }
          opt.on("-l", "--local-hosts hosts", "Host names that are served from --document-root (can be given cache busters). Comma separated") do |hosts|
            @local_hosts = hosts.split(",")
          end
          opt.on("", "--all-hosts-local", "Treat all hosts as local (ie served from --document-root)") { @all_hosts_local = true }
          opt.on("-r", "--relative-urls", "Convert all referenced URLs to relative URLs. Requires --document-root if\n" +
                           (" " * 37) + "absolute URLs are used. Only valid for CSS files") { |t| @relative_urls = true }
          opt.on("-b", "--absolute-urls", "Convert all referenced URLs to absolute URLs. Requires --document-root.\n" +
                           (" " * 37) + "Works with cycled asset hosts. Only valid for CSS files") { |t| @absolute_urls = true }
          opt.on("-d", "--document-root dir", "Path to resolve absolute URLs relative to") { |path| @document_root = path }
          opt.on("-c", "--cache-buster type", "none, soft, rails, hard or md5. Default is soft, which adds timestamps to\n" +
                           (" " * 37) + "reference URLs as query parameters. None leaves URLs untouched, rails adds\n" +
                           (" " * 37) + "timestamps in the same format as Rails' image_tag helper. Hard and md5 alters\n" +
                           (" " * 37) + "file names") do |type|
            @cache_buster = [:soft, :hard, :rails, :md5].include?(type.to_sym) ? type.to_sym : nil
          end
          opt.on("-e", "--embed-images type", "none or data_uri. Default is none. Data_uri embeds images using Base64 encoding\n" +
                           (" " * 37) + "None leaves URLs untouched. Candiate images must be flagged with '?embed=true to be considered") do |embed|
            @image_embed_type = [:none, :data_uri].include?(embed.to_sym) ? embed.to_sym : nil
          end
          opt.on("", "--force-image-embed", "Will force all images to embed without having to tag with embed parameter") { @force_image_embed = true }
        end
      end