From 4f46df9b18a9b3577e85a6682119d6f4b7d7f782 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sun, 26 Jul 2015 03:00:33 +0200 Subject: Add a brief help. --- imapsync | 17 +++++++++++++++-- 1 file 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}; -- cgit v1.2.3