aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-02-21 13:51:41 -0800
committerRobin H. Johnson <robbat2@gentoo.org>2015-02-21 13:51:41 -0800
commitbd4eb9bd65045c50b475b8f475e780c182c5b857 (patch)
treefa07dd3e147a2541a03e54651f35cad5e4a3f47c
parentRemove do_fix/--fix for now, it should be done externally to this. (diff)
downloadbackend-bd4eb9bd65045c50b475b8f475e780c182c5b857.tar.gz
backend-bd4eb9bd65045c50b475b8f475e780c182c5b857.tar.bz2
backend-bd4eb9bd65045c50b475b8f475e780c182c5b857.zip
readonly mode for processing new as well.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rwxr-xr-xag7
1 files changed, 6 insertions, 1 deletions
diff --git a/ag b/ag
index 37c9079..b9f3f75 100755
--- a/ag
+++ b/ag
@@ -19,6 +19,7 @@ $options.name = nil
$options.index_only = false
$options.no_threading = false
$options.debug = false
+$options.readonly = false
op = OptionParser.new do |opts|
opts.banner = "Usage: ag <<--index-full|--index-new|--delete|--reindex|--info> <--list listname>> <maildir/file/hash/messageid> [options]"
@@ -78,6 +79,10 @@ op = OptionParser.new do |opts|
opts.on('--debug', 'Print debug messages') do
$options.debug = true
end
+
+ opts.on('--readonly', 'Do not alter the maildir in any way') do
+ $options.readonly = true
+ end
end
op.parse!
@@ -120,7 +125,7 @@ def do_incremental
begin
Ag::Storage.store($options.name, mail)
- maildir_message.process
+ maildir_message.process unless $options.readonly
rescue => e
$stderr.puts "Cannot save message #{mail.message_id}: #{e.message}"
next