commit a8b5c6db0587fe4383758dc3400aaab85ad22d8b
parent c924164c22a7bdb3fb66f9ce4ca5ac8b19dfcccf
Author: William Morgan <wmorgan-sup@masanjin.net>
Date: Sun, 11 Oct 2009 12:29:01 -0700
fix --compose option, and add a --subject option
Make this spawn a buffer immediately instead of asking something that
gets lost in all the loading messages anyways.
Diffstat:
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/bin/sup b/bin/sup
@@ -36,8 +36,11 @@ EOS
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.
@@ -196,7 +199,10 @@ begin
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]