bin/sup in sup-0.22.1 vs bin/sup in sup-0.23

- old
+ new

@@ -5,20 +5,21 @@ require 'ncursesw' require 'sup/util/ncurses' require 'sup/util/locale_fiddler' +require 'sup/util/axe' no_gpgme = false begin require 'gpgme' rescue LoadError no_gpgme = true end require 'fileutils' -require 'trollop' +require 'optimist' require "sup" if ENV['SUP_PROFILE'] require 'ruby-prof' RubyProf.start @@ -26,29 +27,30 @@ if no_gpgme info "No 'gpgme' gem detected. Install it for email encryption, decryption and signatures." end -$opts = Trollop::options do +$opts = Optimist::options do version "sup v#{Redwood::VERSION}" banner <<EOS Sup is a curses-based email client. Usage: sup [options] Options are: EOS - opt :list_hooks, "List all hooks and descriptions, and quit." + opt :list_hooks, "List all hooks and descriptions, and quit. Use --hooks-matching to filter." + opt :hooks_matching, "If given, list all hooks and descriptions matching the given pattern. Needs the --list-hooks option", short: "m", default: "" opt :no_threads, "Turn off threading. Helps with debugging. (Necessarily disables background polling for new messages.)" opt :no_initial_poll, "Don't poll for new messages when starting." opt :search, "Search for this query upon startup", :type => String opt :compose, "Compose message to this recipient upon startup", :type => String opt :subject, "When composing, use this subject", :type => String, :short => "j" end -Trollop::die :subject, "requires --compose" if $opts[:subject] && !$opts[:compose] +Optimist::die :subject, "requires --compose" if $opts[:subject] && !$opts[:compose] Redwood::HookManager.register "startup", <<EOS Executes at startup No variables. No return value. @@ -62,10 +64,10 @@ No return value. EOS if $opts[:list_hooks] Redwood.start - Redwood::HookManager.print_hooks + Redwood::HookManager.print_hooks $opts[:hooks_matching] exit end Thread.abort_on_exception = true # make debugging possible Thread.current.priority = 1 # keep ui responsive