#!/usr/bin/env ruby require 'optparse' require 'sinatra' require 'ferver' options = {} OptionParser.new do |opts| opts.banner = 'Ferver: A simple web app to serve files over HTTP. Version: ' + Ferver::VERSION opts.separator '' opts.on('-d', '--directory [DIRECTORY]', 'Specify the path to the directory to serve files from [optional]') do |directory| options[:directory] = directory end opts.on("-h", "--help", "Displays help") do puts opts exit end end.parse! Ferver.configure do |config| config.directory_path = options[:directory] end Ferver::App.set :environment, :production # run! Ferver::App.run!