]> git.cworth.org Git - sup/commitdiff
add a --very-verbose option to sup-tweak-labels
authorWilliam Morgan <wmorgan-sup@masanjin.net>
Mon, 18 May 2009 18:16:59 +0000 (14:16 -0400)
committerWilliam Morgan <wmorgan-sup@masanjin.net>
Mon, 18 May 2009 18:16:59 +0000 (14:16 -0400)
bin/sup-tweak-labels

index 0beb77e2c57858f03d7b33e59c23ca5dadd8d5e9..8a8152d60b18db9c0a0dcfd45637e9070ece1293 100755 (executable)
@@ -46,10 +46,12 @@ EOS
 Other options:
 EOS
   opt :verbose, "Print message ids as they're processed."
+  opt :very_verbose, "Print message names and subjects as they're processed."
   opt :all_sources, "Scan over all sources.", :short => :none
   opt :dry_run, "Don't actually modify the index. Probably only useful with --verbose.", :short => "-n"
   opt :version, "Show version information", :short => :none
 end
+opts[:verbose] = true if opts[:very_verbose]
 
 add_labels = (opts[:add] || "").split(",").map { |l| l.intern }.uniq
 remove_labels = (opts[:remove] || "").split(",").map { |l| l.intern }.uniq
@@ -102,7 +104,9 @@ begin
 
     unless m.labels.sort_by { |s| s.to_s } == old_labels.sort_by { |s| s.to_s }
       num_changed += 1
+      puts "From #{m.from}, subject: #{m.subj}" if opts[:very_verbose]
       puts "#{m.id}: {#{old_labels.join ','}} => {#{m.labels.join ','}}" if opts[:verbose]
+      puts if opts[:very_verbose]
       index.sync_message m unless opts[:dry_run]
     end