aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-02-23 20:20:45 -0800
committerRobin H. Johnson <robbat2@gentoo.org>2015-02-23 20:20:45 -0800
commit193f7811ee0156c8b0d52b0c21bfaef528d8f173 (patch)
tree87cbf029beab97959e6ec69cbcb49fdcb14b31c1
parentCleanup check. (diff)
downloadbackend-193f7811ee0156c8b0d52b0c21bfaef528d8f173.tar.gz
backend-193f7811ee0156c8b0d52b0c21bfaef528d8f173.tar.bz2
backend-193f7811ee0156c8b0d52b0c21bfaef528d8f173.zip
Make a rethread command.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rwxr-xr-xag15
1 files changed, 13 insertions, 2 deletions
diff --git a/ag b/ag
index 00ce189..8b08cc2 100755
--- a/ag
+++ b/ag
@@ -30,7 +30,7 @@ $options.need_argument = true
$options.argmode = nil
op = OptionParser.new do |opts|
- opts.banner = "Usage: ag <<--index-full|--index-new|--delete-msg|--delete-index|--reindex|--info> <--list listname>> <[--file|--msgid|--hash] <maildir/file/hash/messageid>> [options]"
+ opts.banner = "Usage: ag <<--index-full|--index-new|--delete-msg|--delete-index|--reindex|--rethread|--info> <--list listname>> <[--file|--msgid|--hash] <maildir/file/hash/messageid>> [options]"
opts.on('--index-full', 'Read the full past archive from Maildir/cur. Needs --list and a Maildir') do
abort 'Can only select one action' if $options.action != nil
@@ -58,6 +58,13 @@ op = OptionParser.new do |opts|
$options.action = :do_create_index
$options.need_argument = false
end
+
+ opts.on('--rethread', 'Rethread messages. Needs --list') do
+ abort 'Can only select one action' if $options.action != nil
+
+ $options.action = :do_rethread
+ $options.need_argument = false
+ end
opts.on('--delete-index', 'Delete index. Needs --list') do
abort 'Can only select one action' if $options.action != nil
@@ -171,7 +178,7 @@ def do_full
end
end
- Ag::Threading.calc($options.name) unless $options.no_threading
+ do_rethread
end
def do_incremental
@@ -194,6 +201,10 @@ def do_incremental
end
end
+ do_rethread
+end
+
+def do_rethread
Ag::Threading.calc($options.name) unless $options.no_threading
end