#!/usr/bin/env ruby $KCODE = 'U' begin require 'gettext' rescue LoadError require 'rubygems' require 'gettext' end require 'alexandria' require 'optparse' require 'ostruct' options = OpenStruct.new OptionParser.new do |opts| opts.banner = "Usage: alexandria [options]" opts.on("-l", "--list", "List libraries in numbered format") { puts Alexandria.list_books_on_console; exit } #opts.on("--output FORMAT", # "Output library as FORMAT: csv|xml|yaml; use with --library or omit for ALL") do |val| # options.format = val; exit #end #opts.on("--library LIBRARY", # "Used with --output to pick a library to output") do |val| # options.library = val; exit #end opts.on("-d", "--debug", "Run in debug mode") { $DEBUG = true } opts.on("-h", "--help", "Show help options") { puts opts; exit } opts.on("-v", "--version", "Get version number") { puts Alexandria::VERSION; exit } end.parse! begin Alexandria.main rescue => e $stderr.puts <