From a3340e1291e1e80f4505ce73bccf34c2de33154c Mon Sep 17 00:00:00 2001 From: SJ Date: Wed, 4 Nov 2015 08:50:41 +0100 Subject: [PATCH] improved usage for pilerexport and pilerimport --- src/pilerexport.c | 27 ++++++++++++++++----------- src/pilerimport.c | 24 ++++++++++++++++++++++-- 2 files changed, 38 insertions(+), 13 deletions(-) diff --git a/src/pilerexport.c b/src/pilerexport.c index 87de0625..f747e76b 100644 --- a/src/pilerexport.c +++ b/src/pilerexport.c @@ -34,17 +34,22 @@ int export_emails_matching_to_query(struct session_data *sdata, struct __data *d void usage(){ - printf("\nusage: pilerexport \n\n"); - printf(" [-c|--config ] \n"); - printf(" -a|--start-date -b|--stop-date \n"); - printf(" -f|--from -r|--to \n"); - printf(" -F|--from-domain -R|--to-domain \n"); - printf(" -s|--minsize -S|--maxsize \n"); - printf(" -w|--where-condition (eg. \"match('@subject: piler')\"\n"); - printf(" -m|--max-matches (default: %d)\n", max_matches); - printf(" -i|--index-list (default: %s)\n", index_list); - printf(" -A|--all -d|--dryrun \n"); - printf("\n use -A if you don't want to specify the start/stop time nor any from/to address\n\n"); + printf("\nusage: pilerexport\n\n"); + + printf(" [-c ] Config file to use if not the default\n"); + printf(" -a Start date in YYYY.MM.DD format\n"); + printf(" -b Stop date in YYYY.MM.DD format\n"); + printf(" -f From address\n"); + printf(" -r Recipient address\n"); + printf(" -F From domain\n"); + printf(" -R Recipient domain\n"); + printf(" -s Min. size\n"); + printf(" -S Max. size\n"); + printf(" -w Where condition to pass to sphinx, eg. \"match('@subject: piler')\"\n"); + printf(" -m Max. matches to apply to sphinx query (default: %d)\n", max_matches); + printf(" -i Sphinx indices to use (default: %s)\n", index_list); + printf(" -A Export all emails from archive\n"); + printf(" -d Dry run\n"); regfree(®exp); diff --git a/src/pilerimport.c b/src/pilerimport.c index 090e9a72..51ca5e7f 100644 --- a/src/pilerimport.c +++ b/src/pilerimport.c @@ -471,8 +471,28 @@ ENDE: void usage(){ - printf("usage: pilerimport [-c ] -e | -m | -d | -i | -K | -u -p -P \n"); - printf(" [-t ] [-x ] [-f ] [-F ] [-b ] [-s ] [-D] [-o] [-R] [-r] [-q]\n"); + printf("\nusage: pilerimport\n\n"); + printf(" [-c ] Config file to use if not the default\n"); + printf(" -e EML file to import\n"); + printf(" -m Mbox file to import\n"); + printf(" -d Directory with EML files to import\n"); + printf(" -i IMAP server to connect\n"); + printf(" -K POP3 server to connect\n"); + printf(" -u Username for imap/pop3 import\n"); + printf(" -p Password for imap/pop3 import\n"); + printf(" -P Port for imap/pop3 import (default: 143/110\n"); + printf(" -t Timeout in sec for imap/pop3 import\n"); + printf(" -x Comma separated list of imap folders to skip. Add the trailing comma!\n"); + printf(" -f IMAP folder name to import\n"); + printf(" -F Piler folder name to assign to this import\n"); + printf(" -b Import only this many emails\n"); + printf(" -s Start importing POP3 emails from this position\n"); + printf(" -D Dry-run, do not import anything\n"); + printf(" -o Only download emails for POP3/IMAP import\n"); + printf(" -R Recursive piler folder names\n"); + printf(" -r Remove imported emails\n"); + printf(" -q Quiet mode\n"); + exit(0); }