Skip to content

Commit

Permalink
Merge #300: sup-tweak-labels sync back unless specified otherwise
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit ebfb333
Author: Wael M. Nasreddine <[email protected]>
Date:   Wed Apr 30 22:26:10 2014 -0700

    sup-tweak-labels: add a newline before the begin

commit f1d51d3
Author: Wael M. Nasreddine <[email protected]>
Date:   Wed Apr 30 22:22:23 2014 -0700

    sup-tweak-labels: sync_back (honor the settings global and source) and provide an override

commit c43319a
Author: Wael M. Nasreddine <[email protected]>
Date:   Tue Apr 29 15:54:01 2014 -0700

    sup-tweak-labels: sync back if specified
  • Loading branch information
kalbasit authored and gauteh committed May 1, 2014
1 parent a680c95 commit a31bc56
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions History.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

* new color option, :with_attachment for defining colors for the
attachment character.
* sup-tweak-labels works again (out of service since sync_back).

== 0.17.0 / 2014-04-11

Expand Down
4 changes: 4 additions & 0 deletions ReleaseNotes
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Release ......:

sup-tweak-labels works again.

Release 0.17.0:

Bugfixes and new option for continous scrolling as well as an option for
Expand Down
7 changes: 6 additions & 1 deletion bin/sup-tweak-labels
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ EOS
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 :no_sync_back, "Do not sync back to the original Maildir."
opt :version, "Show version information", :short => :none
end
opts[:verbose] = true if opts[:very_verbose]
Expand All @@ -63,6 +64,7 @@ Trollop::die "nothing to do: no labels to add or remove" if add_labels.empty? &&
Redwood::start
index = Redwood::Index.init
index.lock_interactively or exit

begin
index.load

Expand Down Expand Up @@ -106,7 +108,10 @@ begin
puts "From #{m.from}, subject: #{m.subj}" if opts[:very_verbose]
puts "#{m.id}: {#{old_labels.to_a.join ','}} => {#{m.labels.to_a.join ','}}" if opts[:verbose]
puts if opts[:very_verbose]
index.update_message_state m unless opts[:dry_run]
unless opts[:dry_run]
index.update_message_state [m, false]
m.sync_back unless opts[:no_sync_back]
end
end

if Time.now - last_info_time > 60
Expand Down

0 comments on commit a31bc56

Please sign in to comment.