bin/sup in sup-0.9 vs bin/sup in sup-0.9.1
- old
+ new
@@ -5,11 +5,11 @@
require 'curses'
require 'fileutils'
require 'trollop'
require "sup"
-BIN_VERSION = "0.9"
+BIN_VERSION = "0.9.1"
unless Redwood::VERSION == BIN_VERSION
$stderr.puts <<EOS
Error: version mismatch!
@@ -34,12 +34,15 @@
opt :list_hooks, "List all hooks and descriptions, and quit."
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]
+
Redwood::HookManager.register "startup", <<EOS
Executes at startup
No variables.
No return value.
EOS
@@ -194,11 +197,14 @@
end unless $opts[:no_initial_poll]
imode.load_threads :num => ibuf.content_height, :when_done => lambda { |num| reporting_thread("poll after loading inbox") { sleep 1; PollManager.poll } unless $opts[:no_threads] || $opts[:no_initial_poll] }
if $opts[:compose]
- ComposeMode.spawn_nicely :to_default => $opts[:compose]
+ to = Person.from_address_list $opts[:compose]
+ mode = ComposeMode.new :to => to, :subj => $opts[:subject]
+ BufferManager.spawn "New Message", mode
+ mode.edit_message
end
unless $opts[:no_threads]
PollManager.start
Index.start_lock_update_thread
@@ -352,10 +358,10 @@
end
$stderr.puts <<EOS
----------------------------------------------------------------
I'm very sorry. It seems that an error occurred in Sup. Please
accept my sincere apologies. If you don't mind, please send the
-contents of ~/.sup/exception-log.txt and a brief report of the
+contents of #{BASE_DIR}/exception-log.txt and a brief report of the
circumstances to sup-talk at rubyforge dot orgs so that I might
address this problem. Thank you!
Sincerely,
William