aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2015-07-26 03:00:33 +0200
committerGuilhem Moulin <guilhem@fripost.org>2015-07-26 03:00:33 +0200
commit4f46df9b18a9b3577e85a6682119d6f4b7d7f782 (patch)
tree63f4ed3b6b8a7d66532cd5f111a6759eb305f46a
parentf3675b5adf9bdb421d668fa7fd894128f2d70a07 (diff)
Add a brief help.
-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};