From 95faae2a4d687a189127621faaeecf17a040c3eb Mon Sep 17 00:00:00 2001 From: Guillermo Ramos Date: Sun, 30 Jun 2019 13:26:27 +0200 Subject: Improve man pages formatting (lists, italics, etc) --- tgrecv | 74 +++++++++++++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 55 insertions(+), 19 deletions(-) (limited to 'tgrecv') diff --git a/tgrecv b/tgrecv index 2d80493..a98820f 100755 --- a/tgrecv +++ b/tgrecv @@ -67,7 +67,6 @@ $cache->offset($updates->[-1]{'update_id'}+1) if ($AUTO_OFFSET && @$updates); print $out encode_json($updates); - __END__ =head1 NAME @@ -76,28 +75,54 @@ tgrecv - Receive updates from Telegram, output them as JSON =head1 SYNOPSIS -tgrecv [-h | --help] [-v] +B [B<-h> | B<--help>] [B<-v>] -tgrecv [options] +B [I] =head1 OPTIONS - --offset Offset of the first message to receive - previous ones are - discarded - --auto-offset Use offset cache to automatically discard previous updates - (if combined with --offset, cache the last update but - still use the provided offset for the current request) - --timeout Timeout for long polling (default: 60 seconds) - --output=file Write the output to file instead of stdout - (--token | -t) Bot token (see AUTHENTICATION) - --version Show version - --verbose | -v Show more information (combine with -h to see full manual) - --help | -h Show this message +=over + +=item B<--offset> + +Offset of the first message to receive - previous ones are discarded + +=item B<--auto-offset> + +Use offset cache to automatically discard previous updates (if combined with +B<--offset>, cache the last update but still use the provided offset for the +current request) + +=item B<--timeout=>I + +Timeout for long polling (default: 60 seconds) + +=item B<--output=>I + +Write the output to I instead of stdout + +=item B<--token>=I, B<-t> I + +Bot token (see B) + +=item B<--version> + +Show version + +=item B<--verbose>, B<-v> + +Show more information (combine with B<-h> to see full manual) + +=item B<--help>, B<-h> + +Show this message + +=back =head1 DESCRIPTION This program receives a single update batch from the Telegram bot identified by -B, and outputs it as a JSON array. The array can contain multiple +I, and outputs it as a JSON array. The array can contain multiple updates. The connection is blocking (long polling), so it waits until an update is available before exiting. @@ -105,9 +130,20 @@ is available before exiting. To get the bot token, this program will check (in order): - - The "--token" CLI argument - - The "TGUTILS_TOKEN" environment variable - - The contents of "$XDG_CONFIG_HOME/tgutils_token" - (usually ~/.config/tgutils_token) +=over 2 + +=item - + +The B<--token> CLI argument + +=item - + +The B environment variable + +=item - + +The contents of I<$XDG_CONFIG_HOME>B (usually B<~/.config/tgutils_token>) + +=back =cut -- cgit v1.2.3