]> git.cworth.org Git - sup/blobdiff - bin/sup
use rsync instead of ssh for webpage transfers, etc
[sup] / bin / sup
diff --git a/bin/sup b/bin/sup
index 95b0af7409b1aa72145df5375c278b5db5d24825..523c685fcf49da16c984df58a4648e69743f75d2 100644 (file)
--- a/bin/sup
+++ b/bin/sup
@@ -7,7 +7,7 @@ require 'fileutils'
 require 'trollop'
 require "sup"
 
-BIN_VERSION = "git"
+BIN_VERSION = "0.5"
 
 unless Redwood::VERSION == BIN_VERSION
   $stderr.puts <<EOS
@@ -32,12 +32,19 @@ Usage:
 
 Options are:
 EOS
-  opt :list_hooks, "List all hooks and descriptions thereof, and quit."
-  opt :no_threads, "Turn of threading. Helps with debugging. (Necessarily disables background polling for new messages.)"
+  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 threads ", :type => String
+  opt :search, "Search for this query upon startup", :type => String
+  opt :compose, "Compose message to this recipient upon startup", :type => String
 end
 
+Redwood::HookManager.register "startup", <<EOS
+Executes at startup
+No variables.
+No return value.
+EOS
+
 if $opts[:list_hooks]
   Redwood::HookManager.print_hooks
   exit
@@ -127,6 +134,8 @@ begin
     Index.add_source SentManager.new_source
   end
 
+  HookManager.run "startup"
+
   log "starting curses"
   start_cursing
 
@@ -137,6 +146,8 @@ begin
            Ncurses::A_BOLD
     c.add :index_starred_color, Ncurses::COLOR_YELLOW, Ncurses::COLOR_BLACK, 
            Ncurses::A_BOLD
+    c.add :index_draft_color, Ncurses::COLOR_RED, Ncurses::COLOR_BLACK,
+           Ncurses::A_BOLD
     c.add :labellist_old_color, Ncurses::COLOR_WHITE, Ncurses::COLOR_BLACK
     c.add :labellist_new_color, Ncurses::COLOR_WHITE, Ncurses::COLOR_BLACK, 
            Ncurses::A_BOLD
@@ -198,6 +209,10 @@ begin
   
   imode.load_threads :num => ibuf.content_height, :when_done => lambda { 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]
+  end
+
   unless $opts[:no_threads]
     PollManager.start
     SuicideManager.start