From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id B09E7138A87 for ; Tue, 24 Feb 2015 04:21:38 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2B9A6E087F; Tue, 24 Feb 2015 04:21:37 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 909BBE087F for ; Tue, 24 Feb 2015 04:21:36 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 4F14C3408BE for ; Tue, 24 Feb 2015 04:21:35 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id ECCBF126D0 for ; Tue, 24 Feb 2015 04:21:33 +0000 (UTC) From: "Robin H. Johnson" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Robin H. Johnson" Message-ID: <1424751645.193f7811ee0156c8b0d52b0c21bfaef528d8f173.robbat2@gentoo> Subject: [gentoo-commits] proj/ag:master commit in: / X-VCS-Repository: proj/ag X-VCS-Files: ag X-VCS-Directories: / X-VCS-Committer: robbat2 X-VCS-Committer-Name: Robin H. Johnson X-VCS-Revision: 193f7811ee0156c8b0d52b0c21bfaef528d8f173 X-VCS-Branch: master Date: Tue, 24 Feb 2015 04:21:33 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 89ed7afb-3642-42e8-b002-d9fb0d9c26ee X-Archives-Hash: 8a2804ce6d30a0f9f5b2006f6b1e5113 commit: 193f7811ee0156c8b0d52b0c21bfaef528d8f173 Author: Robin H. Johnson gentoo org> AuthorDate: Tue Feb 24 04:20:45 2015 +0000 Commit: Robin H. Johnson gentoo org> CommitDate: Tue Feb 24 04:20:45 2015 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/ag.git;a=commit;h=193f7811 Make a rethread command. Signed-off-by: Robin H. Johnson gentoo.org> --- ag | 15 +++++++++++++-- 1 file 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] > [options]" + opts.banner = "Usage: ag <<--index-full|--index-new|--delete-msg|--delete-index|--reindex|--rethread|--info> <--list listname>> <[--file|--msgid|--hash] > [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