aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Rodger <paul@paulrodger.com>2002-03-31 05:01:22 +0000
committerPaul Rodger <paul@paulrodger.com>2002-03-31 05:01:22 +0000
commit17bb56d33ce177234adab9db1d95eac11cb832d5 (patch)
tree3242d03344d2bfe8dd6f9f3c12203440b1b99dce
parent2a67673c077c6a73134a9143d74e20a37e60bd44 (diff)
downloadarchivemail-17bb56d33ce177234adab9db1d95eac11cb832d5.tar.gz
archivemail-17bb56d33ce177234adab9db1d95eac11cb832d5.tar.bz2
archivemail-17bb56d33ce177234adab9db1d95eac11cb832d5.zip
Complain earlier if the output directory does not exist.
-rwxr-xr-xarchivemail.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/archivemail.py b/archivemail.py
index fcd987a..38c5b80 100755
--- a/archivemail.py
+++ b/archivemail.py
@@ -169,6 +169,8 @@ class Options:
if (self.days_old_max >= 10000):
user_error("argument to -d must be less than 10000")
if o in ('-o', '--output-dir'):
+ if not os.path.isdir(a):
+ user_error("output directory does not exist: '%s'" % a)
self.output_dir = a
if o in ('-h', '-?', '--help'):
print usage
@@ -459,15 +461,15 @@ mailbox manageable.
Options are as follows:
-d, --days=<days> archive messages older than <days> days (default: %d)
+ -o, --output-dir=DIR directory where archive files go (default: current)
-s, --suffix=NAME suffix for archive filename (default: '%s')
- -m, --modify-time use file last-modified time as date for maildir messages
-n, --dry-run don't write to anything - just show what would be done
- -o, --output-dir=DIR directory where archive files go (default: current)
-z, --gzip compress the archive(s) using gzip (default)
-I, --bzip2 compress the archive(s) using bzip2
-Z, --compress compress the archive(s) using compress
--delete delete rather than archive old mail (use with caution!)
--warn-duplicate warn about duplicate Message-IDs in the same mailbox
+ -m, --modify-time use file last-modified time as date for maildir messages
-v, --verbose report lots of extra debugging information
-q, --quiet quiet mode - print no statistics (suitable for crontab)
-V, --version display version information