From: William Morgan Date: Mon, 18 May 2009 18:16:59 +0000 (-0400) Subject: add a --very-verbose option to sup-tweak-labels X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=7eb45c6e6d3fc05262900077c21f5245dd61bbcb;p=sup add a --very-verbose option to sup-tweak-labels --- diff --git a/bin/sup-tweak-labels b/bin/sup-tweak-labels index 0beb77e..8a8152d 100755 --- a/bin/sup-tweak-labels +++ b/bin/sup-tweak-labels @@ -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