aboutsummaryrefslogtreecommitdiff
path: root/ag
diff options
context:
space:
mode:
Diffstat (limited to 'ag')
-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