diff --git a/po/cs.po b/po/cs.po index 29d60c4..ee97dcc 100644 --- a/po/cs.po +++ b/po/cs.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Report-Msgid-Bugs-To: pv@ivarch.com\n" -"POT-Creation-Date: 2024-12-08 20:11+0000\n" +"POT-Creation-Date: 2024-12-08 20:38+0000\n" "PO-Revision-Date: 2024-10-13 20:43+0000\n" "Last-Translator: mmatous \n" "Language-Team: Czech \n" @@ -249,18 +249,22 @@ msgstr "ukaž informace o verzi a skonči" msgid "write debug logs to FILE" msgstr "zapiš ladící záznamy do SOUBORu" -#: src/main/help.c:450 +#: src/main/help.c:451 #, c-format msgid "Usage: %s [OPTION] [FILE]..." msgstr "Použití: %s [VOLBY] [SOUBOR]..." -#: src/main/help.c:461 +#: src/main/help.c:462 msgid "" "Concatenate FILE(s), or standard input, to standard output, with monitoring." msgstr "" "Spoj SOUBOR(y) nebo standardní vstup na standardního výstup, s monitoringem." -#: src/main/help.c:598 +#: src/main/help.c:600 +msgid "Supported format sequences:" +msgstr "" + +#: src/main/help.c:614 #, c-format msgid "Please report any bugs to: %s" msgstr "Prosím, hlašte veškeré chyby na: %s" @@ -433,7 +437,7 @@ msgstr "b" msgid "B" msgstr "B" -#: src/pv/display.c:1602 src/pv/transfer.c:1056 +#: src/pv/display.c:1638 src/pv/transfer.c:1056 msgid "buffer allocation failed" msgstr "selhala alokace vyrovnávací paměti" diff --git a/po/de.po b/po/de.po index 1c40079..d86b284 100644 --- a/po/de.po +++ b/po/de.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Report-Msgid-Bugs-To: pv@ivarch.com\n" -"POT-Creation-Date: 2024-12-08 20:11+0000\n" +"POT-Creation-Date: 2024-12-08 20:38+0000\n" "PO-Revision-Date: 2024-10-13 20:43+0000\n" "Last-Translator: fnetX \n" "Language-Team: German \n" @@ -266,19 +266,23 @@ msgstr "zeige Versionsinformationen und beende" msgid "write debug logs to FILE" msgstr "schreibe Debug-Protokolle in DATEI" -#: src/main/help.c:450 +#: src/main/help.c:451 #, c-format msgid "Usage: %s [OPTION] [FILE]..." msgstr "Aufruf: %s [OPTION] [DATEI]..." -#: src/main/help.c:461 +#: src/main/help.c:462 msgid "" "Concatenate FILE(s), or standard input, to standard output, with monitoring." msgstr "" "Verbindet DATEI(en) oder den Standard-Eingabe-Kanal mit dem Standard-Ausgabe-" "Kanal und misst den Datenstrom." -#: src/main/help.c:598 +#: src/main/help.c:600 +msgid "Supported format sequences:" +msgstr "" + +#: src/main/help.c:614 #, c-format msgid "Please report any bugs to: %s" msgstr "Bitte senden Sie Fehlerberichte an %s" @@ -456,7 +460,7 @@ msgstr "b" msgid "B" msgstr "B" -#: src/pv/display.c:1602 src/pv/transfer.c:1056 +#: src/pv/display.c:1638 src/pv/transfer.c:1056 msgid "buffer allocation failed" msgstr "Speicherzuweisung für den Puffer fehlgeschlagen" diff --git a/po/es.po b/po/es.po index 1cdb59f..75155b1 100644 --- a/po/es.po +++ b/po/es.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Report-Msgid-Bugs-To: pv@ivarch.com\n" -"POT-Creation-Date: 2024-12-08 20:11+0000\n" +"POT-Creation-Date: 2024-12-08 20:38+0000\n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -244,17 +244,21 @@ msgstr "" msgid "write debug logs to FILE" msgstr "" -#: src/main/help.c:450 +#: src/main/help.c:451 #, c-format msgid "Usage: %s [OPTION] [FILE]..." msgstr "" -#: src/main/help.c:461 +#: src/main/help.c:462 msgid "" "Concatenate FILE(s), or standard input, to standard output, with monitoring." msgstr "" -#: src/main/help.c:598 +#: src/main/help.c:600 +msgid "Supported format sequences:" +msgstr "" + +#: src/main/help.c:614 #, c-format msgid "Please report any bugs to: %s" msgstr "" @@ -425,7 +429,7 @@ msgstr "" msgid "B" msgstr "" -#: src/pv/display.c:1602 src/pv/transfer.c:1056 +#: src/pv/display.c:1638 src/pv/transfer.c:1056 msgid "buffer allocation failed" msgstr "" diff --git a/po/fr.po b/po/fr.po index 6fc114e..ab82dfe 100644 --- a/po/fr.po +++ b/po/fr.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Report-Msgid-Bugs-To: pv@ivarch.com\n" -"POT-Creation-Date: 2024-12-08 20:11+0000\n" +"POT-Creation-Date: 2024-12-08 20:38+0000\n" "PO-Revision-Date: 2024-10-12 11:13+0000\n" "Last-Translator: a-j-wood \n" "Language-Team: French \n" @@ -267,19 +267,23 @@ msgstr "afficher la version puis quitter" msgid "write debug logs to FILE" msgstr "écrire les journaux de déboggage vers FICHIER" -#: src/main/help.c:450 +#: src/main/help.c:451 #, c-format msgid "Usage: %s [OPTION] [FILE]..." msgstr "Utilisation : %s [OPTIONS] [FICHIER]..." -#: src/main/help.c:461 +#: src/main/help.c:462 msgid "" "Concatenate FILE(s), or standard input, to standard output, with monitoring." msgstr "" "Concaténer FICHIER(s), ou l'entrée standard, sur la sortie standard avec " "monitorage." -#: src/main/help.c:598 +#: src/main/help.c:600 +msgid "Supported format sequences:" +msgstr "" + +#: src/main/help.c:614 #, c-format msgid "Please report any bugs to: %s" msgstr "SVP rapporter tous bogues à %s" @@ -460,7 +464,7 @@ msgstr "" msgid "B" msgstr "O" -#: src/pv/display.c:1602 src/pv/transfer.c:1056 +#: src/pv/display.c:1638 src/pv/transfer.c:1056 msgid "buffer allocation failed" msgstr "échec de l'allocation de mémoire tampon" diff --git a/po/pl.po b/po/pl.po index ea72dab..49a4cb4 100644 --- a/po/pl.po +++ b/po/pl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: pv@ivarch.com\n" -"POT-Creation-Date: 2024-12-08 20:11+0000\n" +"POT-Creation-Date: 2024-12-08 20:38+0000\n" "PO-Revision-Date: 2024-10-20 14:07+0000\n" "Last-Translator: coralpink \n" "Language-Team: Polish \n" @@ -261,19 +261,23 @@ msgstr "wyświetl informacje o wersji i wyjdź" msgid "write debug logs to FILE" msgstr "zapisz logi debugujące do PLIK" -#: src/main/help.c:450 +#: src/main/help.c:451 #, c-format msgid "Usage: %s [OPTION] [FILE]..." msgstr "Sposób użycia: %s [OPCJA] [PLIK]..." -#: src/main/help.c:461 +#: src/main/help.c:462 msgid "" "Concatenate FILE(s), or standard input, to standard output, with monitoring." msgstr "" "Łączenie PLIK(ów) lub wejścia standardowego, do wyjścia standardowego z " "monitoringiem." -#: src/main/help.c:598 +#: src/main/help.c:600 +msgid "Supported format sequences:" +msgstr "" + +#: src/main/help.c:614 #, c-format msgid "Please report any bugs to: %s" msgstr "Proszę przesyłać zgłoszenia błędów do %s" @@ -451,7 +455,7 @@ msgstr "b" msgid "B" msgstr "B" -#: src/pv/display.c:1602 src/pv/transfer.c:1056 +#: src/pv/display.c:1638 src/pv/transfer.c:1056 msgid "buffer allocation failed" msgstr "nie udało się zaalokować bufora" diff --git a/po/pt.po b/po/pt.po index 9192a85..3c85805 100644 --- a/po/pt.po +++ b/po/pt.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: pv@ivarch.com\n" -"POT-Creation-Date: 2024-12-08 20:11+0000\n" +"POT-Creation-Date: 2024-12-08 20:38+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -252,19 +252,23 @@ msgstr "exibe a versão e termina" msgid "write debug logs to FILE" msgstr "" -#: src/main/help.c:450 +#: src/main/help.c:451 #, c-format msgid "Usage: %s [OPTION] [FILE]..." msgstr "Uso: %s [OPÇÕES] [ARQUIVOS]..." -#: src/main/help.c:461 +#: src/main/help.c:462 msgid "" "Concatenate FILE(s), or standard input, to standard output, with monitoring." msgstr "" "Concatena ARQUIVO(s) ou a entrada padrão e grava na saída padrão, com " "monitoramento." -#: src/main/help.c:598 +#: src/main/help.c:600 +msgid "Supported format sequences:" +msgstr "" + +#: src/main/help.c:614 #, c-format msgid "Please report any bugs to: %s" msgstr "Por favor, reporte quaisquer defeitos para %s" @@ -439,7 +443,7 @@ msgstr "" msgid "B" msgstr "" -#: src/pv/display.c:1602 src/pv/transfer.c:1056 +#: src/pv/display.c:1638 src/pv/transfer.c:1056 msgid "buffer allocation failed" msgstr "erro alocando o buffer" diff --git a/po/ru.po b/po/ru.po index d422803..33d1c97 100644 --- a/po/ru.po +++ b/po/ru.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Report-Msgid-Bugs-To: pv@ivarch.com\n" -"POT-Creation-Date: 2024-12-08 20:11+0000\n" +"POT-Creation-Date: 2024-12-08 20:38+0000\n" "PO-Revision-Date: 2024-10-22 18:07+0000\n" "Last-Translator: 0ko <0ko@users.noreply.translate.codeberg.org>\n" "Language-Team: Russian \n" @@ -251,17 +251,21 @@ msgstr "показать версию программы и завершить msgid "write debug logs to FILE" msgstr "вести запись отладочного журнала в ФАЙЛ" -#: src/main/help.c:450 +#: src/main/help.c:451 #, c-format msgid "Usage: %s [OPTION] [FILE]..." msgstr "Использование: %s [ОПЦИИ] [ФАЙЛ]..." -#: src/main/help.c:461 +#: src/main/help.c:462 msgid "" "Concatenate FILE(s), or standard input, to standard output, with monitoring." msgstr "" -#: src/main/help.c:598 +#: src/main/help.c:600 +msgid "Supported format sequences:" +msgstr "" + +#: src/main/help.c:614 #, c-format msgid "Please report any bugs to: %s" msgstr "Сообщайте о проблемах на: %s" @@ -434,7 +438,7 @@ msgstr "бит" msgid "B" msgstr "байт" -#: src/pv/display.c:1602 src/pv/transfer.c:1056 +#: src/pv/display.c:1638 src/pv/transfer.c:1056 msgid "buffer allocation failed" msgstr "не удалось выделить память для буфера" diff --git a/po/tr.po b/po/tr.po index a6b1ff2..48fbcfa 100644 --- a/po/tr.po +++ b/po/tr.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: pv 1.8.14\n" "Report-Msgid-Bugs-To: pv@ivarch.com\n" -"POT-Creation-Date: 2024-12-08 20:11+0000\n" +"POT-Creation-Date: 2024-12-08 20:38+0000\n" "PO-Revision-Date: 2024-10-12 23:51+0000\n" "Last-Translator: a-j-wood \n" "Language-Team: Turkish \n" @@ -250,18 +250,22 @@ msgstr "sürüm bilgilerini göster ve çık" msgid "write debug logs to FILE" msgstr "Hata ayıklama kayıtlarını DOSYA'ya yaz" -#: src/main/help.c:450 +#: src/main/help.c:451 #, c-format msgid "Usage: %s [OPTION] [FILE]..." msgstr "Kullanım şekli: %s [AYAR] [DOSYA]..." -#: src/main/help.c:461 +#: src/main/help.c:462 msgid "" "Concatenate FILE(s), or standard input, to standard output, with monitoring." msgstr "" "İzleme ile DOSYA(lar)ı veya standart girdiyi standart çıktı ile birleştirin." -#: src/main/help.c:598 +#: src/main/help.c:600 +msgid "Supported format sequences:" +msgstr "" + +#: src/main/help.c:614 #, c-format msgid "Please report any bugs to: %s" msgstr "Lütfen hataları şu adrese bildirin: %s" @@ -435,7 +439,7 @@ msgstr "b" msgid "B" msgstr "B" -#: src/pv/display.c:1602 src/pv/transfer.c:1056 +#: src/pv/display.c:1638 src/pv/transfer.c:1056 msgid "buffer allocation failed" msgstr "arabellek tahsisi başarısız oldu" diff --git a/src/include/pv.h b/src/include/pv.h index 035b360..50e3fdd 100644 --- a/src/include/pv.h +++ b/src/include/pv.h @@ -275,6 +275,11 @@ extern void pv_sig_fini(pvstate_t); */ extern void pv_state_free(/*@only@*/ pvstate_t); +/* + * Return a string listing all supported format sequences. + */ +/*@null@*/ char *pv_format_sequences(void); + #if ! HAVE_SETPROCTITLE void initproctitle(int, char **); void setproctitle(const char *, ...); diff --git a/src/main/help.c b/src/main/help.c index b59cc0c..261691a 100644 --- a/src/main/help.c +++ b/src/main/help.c @@ -434,6 +434,7 @@ void display_help(void) size_t right_margin = 77; const char *program_description; const char *bug_report_note; + char *format_sequences = NULL; unsigned int terminal_width = 0, terminal_height = 0; pv_screensize(&terminal_width, &terminal_height); @@ -593,6 +594,21 @@ void display_help(void) printf("\n"); } + format_sequences = pv_format_sequences(); + if (NULL != format_sequences) { + const char *format_sequence_header; + format_sequence_header = _("Supported format sequences:"); + if (NULL != format_sequence_header) { + printf("\n"); + display_word_wrap(format_sequence_header, right_margin, 0); + printf("\n"); + } + printf("\n "); + display_word_wrap(format_sequences, right_margin, 2); + free(format_sequences); + printf("\n"); + } + printf("\n"); bug_report_note = _("Please report any bugs to: %s"); diff --git a/src/pv/display.c b/src/pv/display.c index 6c87d0e..df96f36 100644 --- a/src/pv/display.c +++ b/src/pv/display.c @@ -1329,6 +1329,42 @@ static struct pvdisplay_component_s { }; +/* + * Return a pointer to a malloc()ed string containing a space-separated list + * of all supported format sequences. The caller should free() it. + */ +/*@null@ */ +char *pv_format_sequences(void) +{ + size_t component_idx, buffer_size, offset; + char *buffer; + + buffer_size = 0; + for (component_idx = 0; NULL != format_component[component_idx].match; component_idx++) { + size_t component_sequence_length = strlen(format_component[component_idx].match); /* flawfinder: ignore */ + /* flawfinder - static strings, guaranteed null-terminated. */ + buffer_size += 2 + component_sequence_length; /* 2 for '%' + ' ' */ + } + + buffer = malloc(buffer_size + 1); + if (NULL == buffer) + return NULL; + + offset = 0; + for (component_idx = 0; NULL != format_component[component_idx].match; component_idx++) { + size_t component_sequence_length = strlen(format_component[component_idx].match); /* flawfinder: ignore - as above */ + if (0 != offset) + buffer[offset++] = ' '; + buffer[offset++] = '%'; + memmove(buffer + offset, format_component[component_idx].match, component_sequence_length); + offset += component_sequence_length; + } + + buffer[offset] = '\0'; + return buffer; +} + + /* * Initialise the output format structure, based on the current options. */