def parse_options
      @options = {
        :environment  => 'production',
        :config_path  => ENV['CLOUD_CROWD_CONFIG'] || '.',
        :daemonize    => false
      }
      @option_parser = OptionParser.new do |opts|
        opts.on('-c', '--config PATH', 'path to configuration directory') do |conf_path|
          @options[:config_path] = conf_path
        end
        opts.on('-p', '--port PORT', 'port number for server (central or node)') do |port_num|
          @options[:port] = port_num
        end
        opts.on('-e', '--environment ENV', 'server environment (defaults to production)') do |env|
          @options[:environment] = env
        end
        opts.on('-t', '--tag TAG', 'tag a node with a name') do |tag|
          @options[:tag] = tag
        end
        opts.on('-d', '--daemonize', 'run as a background daemon') do |daemonize|
          @options[:daemonize] = daemonize
        end
        opts.on('--days NUM_DAYS', 'grace period before cleanup (7 by default)') do |days|
          @options[:days] = days.to_i if days.match(/\A\d+\Z/)
        end
        opts.on_tail('-v', '--version', 'show version') do
          require "#{CC_ROOT}/lib/cloud-crowd"
          puts "CloudCrowd version #{VERSION}"
          exit
        end
      end
      @option_parser.banner = BANNER
      @option_parser.parse!(ARGV)
    end
def parse_options
      @options = {
        :environment  => 'production',
        :config_path  => ENV['CLOUD_CROWD_CONFIG'] || '.',
        :daemonize    => false
      }
      @option_parser = OptionParser.new do |opts|
        opts.on('-c', '--config PATH', 'path to configuration directory') do |conf_path|
          @options[:config_path] = conf_path
        end
        opts.on('-p', '--port PORT', 'port number for server (central or node)') do |port_num|
          @options[:port] = port_num
        end
        opts.on('-e', '--environment ENV', 'server environment (defaults to production)') do |env|
          @options[:environment] = env
        end
        opts.on('-t', '--tag TAG', 'tag a node with a name') do |tag|
          @options[:tag] = tag
        end
        opts.on('-d', '--daemonize', 'run as a background daemon') do |daemonize|
          @options[:daemonize] = daemonize
        end
        opts.on('--days NUM_DAYS', 'grace period before cleanup (7 by default)') do |days|
          @options[:days] = days.to_i if days.match(/\A\d+\Z/)
        end
        opts.on_tail('-v', '--version', 'show version') do
          require "#{CC_ROOT}/lib/cloud-crowd"
          puts "CloudCrowd version #{VERSION}"
          exit
        end
      end
      @option_parser.banner = BANNER
      @option_parser.parse!(ARGV)
    end
Parse all options for all commands.
 Valid options are: --config --port --environment --tag --daemonize --days.