aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-ximapsync17
1 files changed, 15 insertions, 2 deletions
diff --git a/imapsync b/imapsync
index d24723d..fec37f0 100755
--- a/imapsync
+++ b/imapsync
@@ -39,10 +39,23 @@ delete @ENV{qw/IFS CDPATH ENV BASH_ENV/};
my %CONFIG;
sub usage(;$) {
my $rv = shift // 0;
- print STDERR "TODO $NAME usage\n";
+ print STDERR "$NAME [OPTIONS] [--] [MAILBOX [..]]\n";
+ if ($rv) {
+ print STDERR "Try '$NAME --help' or consult the manpage for more information.\n";
+ }
+ else {
+ print STDERR "Synchronize the given MAILBOXes between two QRESYNC-capable IMAP4rev1 servers.\n"
+ ."Options:\n"
+ ." --config=FILE Specify an alternate configuration file\n"
+ ." -1, --oneshot Exit as soon as all mailboxes are synchronized\n"
+ ." --repair List the database anomalies and try to repair them\n"
+ ." -q, --quiet Try to be quiet\n"
+ ." --debug Turn on debug mode\n"
+ ."Consult the manpage for more information.\n";
+ }
exit $rv;
}
-usage(1) unless GetOptions(\%CONFIG, qw/debug help|h config=s quiet|q oneshot|1 repair/);
+usage(1) unless GetOptions(\%CONFIG, qw/config=s quiet|q oneshot|1 repair debug help|h/);
usage(0) if $CONFIG{help};