<%-
result = []

if @verbosity
  # Verbosity
  result << '"-' + @verbosity.to_s + '"'
end

# Use <num> MB memory max to use for object storage.
result << '"-m" "' + scope.call_function('memcached::max_memory', [@max_memory]).to_s + '"'

if @lock_memory
  # Lock down all paged memory.  There is a limit on how much memory you may lock.
  result << '"-k"'
end

if @use_sasl
  # Start with SASL support
  result << '"-S"'
end

if @use_tls
  # Start with TLS support
  result << '"-Z"'
  result << '"-o" "ssl_chain_cert="' + @tls_cert_chain + '"'
  result << '"-o" "ssl_key="' + @tls_key + '"'
  if @tls_ca_cert
    result << '"-o" "ssl_ca_cert="' + @tls_ca_cert + '"'
  end
  result << '"-o" "ssl_verify_mode="' + @tls_verify_mode + '"'
end

if @unix_socket
  # UNIX socket path to listen on
  result << '"-s" "' + @unix_socket + '"'

  # UNIX socket access mask
  result << '"-a" "' + @unix_socket_mask + '"'
else
  if @real_listen
    # interface to listen on
    result << '"-l" "' + @real_listen.join(',') + '"'
  end

  # TCP port to listen on
  if @tcp_port
    result << '"-p" "' + @tcp_port.to_s + '"'
  end

  # UDP port to listen on
  if @udp_port
    result << '"-U" "' + @udp_port.to_s + '"'
  end
end

# Run daemon as user
result << '"-u" "' + @user + '"'

if @large_mem_pages
  # Try to use large memory pages (if available)
  result << '"-L"'
end

# Limit the number of simultaneous incoming connections.
result << '"-c" "' + @max_connections.to_s + '"'

# Number of threads to use to process incoming requests.
result << '"-t" "' + @processorcount.to_s + '"'

if @max_item_size
  # Override  the  default size of each slab page
  result << '"-I" "' + @max_item_size.to_s + '"'
end
if @min_item_size
  result << '"-n" "' + @min_item_size.to_s + '"'
end
if @factor
  result << '"-f" "' + @factor.to_s + '"'
end
if @auto_removal
  # Disable automatic removal of items from the cache when out of memory
  result << '"-M"'
end

if @extended_opts
  result << '"-o" "' + @extended_opts.join(',') + '"'
end

if @disable_cachedump
  result << '"-X"'
end -%>
<%= result.join(' ') -%>
