Permit decimals with suffix for --size, --rate-limit, --buffer-size, and --error-skip-block (#35); and document the types of numbers allowed in the manual.

This commit is contained in:
Andrew Wood
2024-12-10 22:09:32 +00:00
parent 73bc1ab139
commit 1d76c0bc64
14 changed files with 198 additions and 123 deletions
+1
View File
@@ -1,5 +1,6 @@
### UNRELEASED
* *feature:* allow decimal values such as "1.5G" with "**--size**", "**--rate-limit**", "**--buffer-size**", and "**error-skip-block**" ([#35](https://codeberg.org/a-j-wood/pv/issues/35))
* *docs:* simplified the synopsis section of the manual
### 1.9.15 - 8 December 2024
+15
View File
@@ -663,6 +663,21 @@ passed to \*(lq\fB\-\-size\fR\*(rq, and activate
The \*(lq\fB%nA\fR\*(rq and \*(lq\fB%nL\fR\*(rq format sequences may not be
effective with small input files, and \*(lq\fB%nL\fR\*(rq may be a few lines
out due to buffering within the pipeline itself.
.PP
Numbers passed to \*(lq\fB\-\-size\fR\*(rq, \*(lq\fB\-\-rate\-limit\fR\*(rq,
\*(lq\fB\-\-buffer\-size\fR\*(rq, and \*(lq\fB\-\-error\-skip\-block\fR\*(rq
may all be expressed as decimals if followed by a suffix, so for example
\*(lq\fI\-\-size\~1.5G\fR\*(rq is equivalent to
\*(lq\fI\-\-size\~1536M\fR\*(rq.
.PP
Numbers passed to \*(lq\fB\-\-interval\fR\*(rq and
\*(lq\fB\-\-delay\-start\fR\*(rq may be integers or decimals, but may not
have a suffix.
.PP
Numbers passed to \*(lq\fB\-\-last\-written\fR\*(rq,
\*(lq\fB\-\-width\fR\*(rq, \*(lq\fB\-\-height\fR\*(rq,
\*(lq\fB\-\-average\-rate\-window\fR\*(rq, and \*(lq\fB\-\-remote\fR\*(rq
must be integers with no suffix.
.\"
.SH REPORTING BUGS
Please report any bugs to \fBpv@ivarch.com\fR.
+12
View File
@@ -651,6 +651,18 @@ The "**%nA**" and "**%nL**" format sequences may not be effective with
small input files, and "**%nL**" may be a few lines out due to buffering
within the pipeline itself.
Numbers passed to "**\--size**", "**\--rate-limit**",
"**\--buffer-size**", and "**\--error-skip-block**" may all be expressed
as decimals if followed by a suffix, so for example "*\--size 1.5G*" is
equivalent to "*\--size 1536M*".
Numbers passed to "**\--interval**" and "**\--delay-start**" may be
integers or decimals, but may not have a suffix.
Numbers passed to "**\--last-written**", "**\--width**",
"**\--height**", "**\--average-rate-window**", and "**\--remote**" must
be integers with no suffix.
# REPORTING BUGS
Please report any bugs to **pv@ivarch.com**.
+16 -12
View File
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Report-Msgid-Bugs-To: pv@ivarch.com\n"
"POT-Creation-Date: 2024-12-09 23:15+0000\n"
"POT-Creation-Date: 2024-12-10 22:03+0000\n"
"PO-Revision-Date: 2024-10-13 20:43+0000\n"
"Last-Translator: mmatous <mmatous@users.noreply.translate.codeberg.org>\n"
"Language-Team: Czech <https://translate.codeberg.org/projects/pv/pv/cs/>\n"
@@ -309,33 +309,37 @@ msgstr "selhala alokace struktury pro volby"
msgid "option structure argv allocation failed"
msgstr "selhala alokace struktury pro argv"
#: src/main/options.c:425
#: src/main/options.c:416
msgid "numeric value not understood"
msgstr ""
#: src/main/options.c:435
msgid "integer argument expected"
msgstr "očekáván celočíselný argument"
#: src/main/options.c:436
#: src/main/options.c:447
msgid "numeric argument expected"
msgstr "očekáván číselný argument"
#: src/main/options.c:447
#: src/main/options.c:458
msgid "process ID or pid:fd pair expected"
msgstr "očekáváno ID procesu nebo dvojice PID:DS"
#: src/main/options.c:454
#: src/main/options.c:465
msgid "invalid process ID"
msgstr "neplatné ID procesu"
#: src/main/options.c:679
#: src/main/options.c:690
#, c-format
msgid "Try `%s --help' for more information."
msgstr "Zkuste `%s --help' pro více informací."
#: src/main/options.c:681
#: src/main/options.c:692
#, c-format
msgid "Try `%s -h' for more information."
msgstr "Zkuste `%s --h' pro více informací."
#: src/main/options.c:712
#: src/main/options.c:723
msgid ""
"cannot use line mode or transfer modifier options when watching file "
"descriptors"
@@ -343,19 +347,19 @@ msgstr ""
"při sledování deskriptorů souborů nelze použít řádkový mód nebo volby pro "
"modifikaci přenosu"
#: src/main/options.c:721
#: src/main/options.c:732
msgid "cannot use cursor positioning when watching file descriptors"
msgstr "při sledování deskriptorů souborů nelze pozicování kurzoru použít"
#: src/main/options.c:730
#: src/main/options.c:741
msgid "cannot use remote control when watching file descriptors"
msgstr "při sledování deskriptorů souborů nelze použít vzdálené ovládání"
#: src/main/options.c:739
#: src/main/options.c:750
msgid "cannot transfer files when watching file descriptors"
msgstr "při sledování deskriptorů souborů nelze použít přenos souborů"
#: src/main/options.c:754
#: src/main/options.c:765
msgid "not available on systems without /proc/self/fdinfo"
msgstr "není dostupné na systémech bez /proc/self/fdinfo"
+16 -12
View File
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Report-Msgid-Bugs-To: pv@ivarch.com\n"
"POT-Creation-Date: 2024-12-09 23:15+0000\n"
"POT-Creation-Date: 2024-12-10 22:03+0000\n"
"PO-Revision-Date: 2024-10-13 20:43+0000\n"
"Last-Translator: fnetX <otto@codeberg.org>\n"
"Language-Team: German <https://translate.codeberg.org/projects/pv/pv/de/>\n"
@@ -327,33 +327,37 @@ msgstr "Speicherzuweisung für `option' fehlgeschlagen"
msgid "option structure argv allocation failed"
msgstr "Speicherzuweisung für `argv' der Option fehlgeschlagen"
#: src/main/options.c:425
#: src/main/options.c:416
msgid "numeric value not understood"
msgstr ""
#: src/main/options.c:435
msgid "integer argument expected"
msgstr "Ganzzahliges Argument erwartet"
#: src/main/options.c:436
#: src/main/options.c:447
msgid "numeric argument expected"
msgstr "numerisches Argument erwartet"
#: src/main/options.c:447
#: src/main/options.c:458
msgid "process ID or pid:fd pair expected"
msgstr "Prozess-ID oder PID:FD-Paar erwartet"
#: src/main/options.c:454
#: src/main/options.c:465
msgid "invalid process ID"
msgstr "ungültige Prozess-ID"
#: src/main/options.c:679
#: src/main/options.c:690
#, c-format
msgid "Try `%s --help' for more information."
msgstr "`%s --help' zeigt weitere Informationen an."
#: src/main/options.c:681
#: src/main/options.c:692
#, c-format
msgid "Try `%s -h' for more information."
msgstr "`%s -h' zeigt weitere Informationen an."
#: src/main/options.c:712
#: src/main/options.c:723
msgid ""
"cannot use line mode or transfer modifier options when watching file "
"descriptors"
@@ -361,24 +365,24 @@ msgstr ""
"Beim Beobachten von Dateideskriptoren können keine Optionen für den "
"Zeilenmodus oder den Übertragungsmodifikator verwendet werden"
#: src/main/options.c:721
#: src/main/options.c:732
msgid "cannot use cursor positioning when watching file descriptors"
msgstr ""
"Beim Beobachten von Dateideskriptoren kann Cursor-Positionierung nicht "
"verwendet werden"
#: src/main/options.c:730
#: src/main/options.c:741
msgid "cannot use remote control when watching file descriptors"
msgstr ""
"Beim Beobachten von Dateideskriptoren kann die Fernbedienung nicht verwenden "
"werden"
#: src/main/options.c:739
#: src/main/options.c:750
msgid "cannot transfer files when watching file descriptors"
msgstr ""
"Beim Beobachten von Dateideskriptoren können Dateien nicht übertragen werden"
#: src/main/options.c:754
#: src/main/options.c:765
msgid "not available on systems without /proc/self/fdinfo"
msgstr "Nicht verfügbar auf Systemen ohne /proc/self/fdinfo"
+16 -12
View File
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Report-Msgid-Bugs-To: pv@ivarch.com\n"
"POT-Creation-Date: 2024-12-09 23:15+0000\n"
"POT-Creation-Date: 2024-12-10 22:03+0000\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -303,51 +303,55 @@ msgstr ""
msgid "option structure argv allocation failed"
msgstr ""
#: src/main/options.c:425
#: src/main/options.c:416
msgid "numeric value not understood"
msgstr ""
#: src/main/options.c:435
msgid "integer argument expected"
msgstr ""
#: src/main/options.c:436
#: src/main/options.c:447
msgid "numeric argument expected"
msgstr ""
#: src/main/options.c:447
#: src/main/options.c:458
msgid "process ID or pid:fd pair expected"
msgstr ""
#: src/main/options.c:454
#: src/main/options.c:465
msgid "invalid process ID"
msgstr ""
#: src/main/options.c:679
#: src/main/options.c:690
#, c-format
msgid "Try `%s --help' for more information."
msgstr ""
#: src/main/options.c:681
#: src/main/options.c:692
#, c-format
msgid "Try `%s -h' for more information."
msgstr ""
#: src/main/options.c:712
#: src/main/options.c:723
msgid ""
"cannot use line mode or transfer modifier options when watching file "
"descriptors"
msgstr ""
#: src/main/options.c:721
#: src/main/options.c:732
msgid "cannot use cursor positioning when watching file descriptors"
msgstr ""
#: src/main/options.c:730
#: src/main/options.c:741
msgid "cannot use remote control when watching file descriptors"
msgstr ""
#: src/main/options.c:739
#: src/main/options.c:750
msgid "cannot transfer files when watching file descriptors"
msgstr ""
#: src/main/options.c:754
#: src/main/options.c:765
msgid "not available on systems without /proc/self/fdinfo"
msgstr ""
+16 -12
View File
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Report-Msgid-Bugs-To: pv@ivarch.com\n"
"POT-Creation-Date: 2024-12-09 23:15+0000\n"
"POT-Creation-Date: 2024-12-10 22:03+0000\n"
"PO-Revision-Date: 2024-10-12 11:13+0000\n"
"Last-Translator: a-j-wood <a-j-wood@users.noreply.translate.codeberg.org>\n"
"Language-Team: French <https://translate.codeberg.org/projects/pv/pv/fr/>\n"
@@ -328,33 +328,37 @@ msgstr "l'allocation pour la structure d'une option a échoué"
msgid "option structure argv allocation failed"
msgstr "l'allocation pour la structure de l'option argv a échoué"
#: src/main/options.c:425
#: src/main/options.c:416
msgid "numeric value not understood"
msgstr ""
#: src/main/options.c:435
msgid "integer argument expected"
msgstr "Valeur entière attendue"
#: src/main/options.c:436
#: src/main/options.c:447
msgid "numeric argument expected"
msgstr "Valeur numérique attendue"
#: src/main/options.c:447
#: src/main/options.c:458
msgid "process ID or pid:fd pair expected"
msgstr "ID de processus ou paire pid:fd attendue"
#: src/main/options.c:454
#: src/main/options.c:465
msgid "invalid process ID"
msgstr "ID de processus non valide"
#: src/main/options.c:679
#: src/main/options.c:690
#, c-format
msgid "Try `%s --help' for more information."
msgstr "Essayez `%s --help' pour plus d'informations."
#: src/main/options.c:681
#: src/main/options.c:692
#, c-format
msgid "Try `%s -h' for more information."
msgstr "Essayez `%s -h' pour plus d'informations."
#: src/main/options.c:712
#: src/main/options.c:723
msgid ""
"cannot use line mode or transfer modifier options when watching file "
"descriptors"
@@ -362,25 +366,25 @@ msgstr ""
"impossible d'utiliser le mode ligne ou les options de modificateur de "
"transfert lors de la visualisation des descripteurs de fichiers"
#: src/main/options.c:721
#: src/main/options.c:732
msgid "cannot use cursor positioning when watching file descriptors"
msgstr ""
"impossible d'utiliser le positionnement du curseur lors de la visualisation "
"des descripteurs de fichier"
#: src/main/options.c:730
#: src/main/options.c:741
msgid "cannot use remote control when watching file descriptors"
msgstr ""
"impossible d'utiliser la télécommande lors de la visualisation des "
"descripteurs de fichiers"
#: src/main/options.c:739
#: src/main/options.c:750
msgid "cannot transfer files when watching file descriptors"
msgstr ""
"impossible de transférer des fichiers lorsque vous regardez des descripteurs "
"de fichiers"
#: src/main/options.c:754
#: src/main/options.c:765
msgid "not available on systems without /proc/self/fdinfo"
msgstr "non disponible sur les systèmes sans /proc/self/fdinfo"
+16 -12
View File
@@ -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-09 23:15+0000\n"
"POT-Creation-Date: 2024-12-10 22:03+0000\n"
"PO-Revision-Date: 2024-10-20 14:07+0000\n"
"Last-Translator: coralpink <coralpink@users.noreply.translate.codeberg.org>\n"
"Language-Team: Polish <https://translate.codeberg.org/projects/pv/pv/pl/>\n"
@@ -322,33 +322,37 @@ msgstr "nie udało się zaalokować struktur opcji"
msgid "option structure argv allocation failed"
msgstr "nie udało się zaalokować struktur opcji argv"
#: src/main/options.c:425
#: src/main/options.c:416
msgid "numeric value not understood"
msgstr ""
#: src/main/options.c:435
msgid "integer argument expected"
msgstr "oczekiwany argument typu liczby całkowitej"
#: src/main/options.c:436
#: src/main/options.c:447
msgid "numeric argument expected"
msgstr "oczekiwany argument liczbowy"
#: src/main/options.c:447
#: src/main/options.c:458
msgid "process ID or pid:fd pair expected"
msgstr "oczekiwany proces ID lub para PID:FD"
#: src/main/options.c:454
#: src/main/options.c:465
msgid "invalid process ID"
msgstr "niepoprawne ID procesu"
#: src/main/options.c:679
#: src/main/options.c:690
#, c-format
msgid "Try `%s --help' for more information."
msgstr "Spróbuj `%s --help' by uzyskać więcej informacji."
#: src/main/options.c:681
#: src/main/options.c:692
#, c-format
msgid "Try `%s -h' for more information."
msgstr "Spróbuj `%s -h' by uzyskać więcej informacji."
#: src/main/options.c:712
#: src/main/options.c:723
msgid ""
"cannot use line mode or transfer modifier options when watching file "
"descriptors"
@@ -356,23 +360,23 @@ msgstr ""
"nie można użyć trybu zliczania linii lub opcji modyfikujących przesył "
"łącznie z opcją obserwowania deskryptorów plików"
#: src/main/options.c:721
#: src/main/options.c:732
msgid "cannot use cursor positioning when watching file descriptors"
msgstr ""
"nie można użyć pozycjonowania kursora łącznie z opcją obserwowania "
"deskryptorów plików"
#: src/main/options.c:730
#: src/main/options.c:741
msgid "cannot use remote control when watching file descriptors"
msgstr ""
"nie można użyć opcji zaktualizowania ustawień procesu łącznie z opcją "
"obserwowania deskryptorów plików"
#: src/main/options.c:739
#: src/main/options.c:750
msgid "cannot transfer files when watching file descriptors"
msgstr "nie można przesyłać plików z opcją obserwowania deskryptorów plików"
#: src/main/options.c:754
#: src/main/options.c:765
msgid "not available on systems without /proc/self/fdinfo"
msgstr "niedostępne na systemach bez /proc/self/fdinfo"
+16 -12
View File
@@ -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-09 23:15+0000\n"
"POT-Creation-Date: 2024-12-10 22:03+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -313,33 +313,37 @@ msgstr "erro na alocação da estrutura de opções"
msgid "option structure argv allocation failed"
msgstr "erro na alocação da estrutura de opções argv"
#: src/main/options.c:425
#: src/main/options.c:416
msgid "numeric value not understood"
msgstr ""
#: src/main/options.c:435
msgid "integer argument expected"
msgstr "argumento inteiro esperado"
#: src/main/options.c:436
#: src/main/options.c:447
msgid "numeric argument expected"
msgstr "argumento numérico esperado"
#: src/main/options.c:447
#: src/main/options.c:458
msgid "process ID or pid:fd pair expected"
msgstr "ID do processo ou par pid:fd esperado"
#: src/main/options.c:454
#: src/main/options.c:465
msgid "invalid process ID"
msgstr "ID de processo inválido"
#: src/main/options.c:679
#: src/main/options.c:690
#, c-format
msgid "Try `%s --help' for more information."
msgstr "Tente `%s --help' para maiores informações."
#: src/main/options.c:681
#: src/main/options.c:692
#, c-format
msgid "Try `%s -h' for more information."
msgstr "Tente `%s -h' para maiores informações."
#: src/main/options.c:712
#: src/main/options.c:723
msgid ""
"cannot use line mode or transfer modifier options when watching file "
"descriptors"
@@ -347,21 +351,21 @@ msgstr ""
"não pode usar o modo de linha ou opções de modificador de transferência ao "
"assistir os descritores de arquivo"
#: src/main/options.c:721
#: src/main/options.c:732
msgid "cannot use cursor positioning when watching file descriptors"
msgstr ""
"não pode usar o posicionamento do cursor ao observar os descritores de "
"arquivo"
#: src/main/options.c:730
#: src/main/options.c:741
msgid "cannot use remote control when watching file descriptors"
msgstr "não pode usar o controle remoto ao assistir os descritores de arquivo"
#: src/main/options.c:739
#: src/main/options.c:750
msgid "cannot transfer files when watching file descriptors"
msgstr "não pode transferir arquivos ao assistir descritores de arquivo"
#: src/main/options.c:754
#: src/main/options.c:765
msgid "not available on systems without /proc/self/fdinfo"
msgstr "não disponível em sistemas sem /proc/self/fdinfo"
+16 -12
View File
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Report-Msgid-Bugs-To: pv@ivarch.com\n"
"POT-Creation-Date: 2024-12-09 23:15+0000\n"
"POT-Creation-Date: 2024-12-10 22:03+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 <https://translate.codeberg.org/projects/pv/pv/ru/>\n"
@@ -310,51 +310,55 @@ msgstr "не удалось выделить память для структу
msgid "option structure argv allocation failed"
msgstr "не удалось выделить память для структуры опций argv"
#: src/main/options.c:425
#: src/main/options.c:416
msgid "numeric value not understood"
msgstr ""
#: src/main/options.c:435
msgid "integer argument expected"
msgstr "ожидалось целое число"
#: src/main/options.c:436
#: src/main/options.c:447
msgid "numeric argument expected"
msgstr "ожидалось число"
#: src/main/options.c:447
#: src/main/options.c:458
msgid "process ID or pid:fd pair expected"
msgstr "ожидался ИД процесса или пара ИДпр:ДФ"
#: src/main/options.c:454
#: src/main/options.c:465
msgid "invalid process ID"
msgstr "неправильный ИД процесса"
#: src/main/options.c:679
#: src/main/options.c:690
#, c-format
msgid "Try `%s --help' for more information."
msgstr "Выполните `%s --help' для получения подробностей."
#: src/main/options.c:681
#: src/main/options.c:692
#, c-format
msgid "Try `%s -h' for more information."
msgstr "Выполните `%s -h' для получения подробностей."
#: src/main/options.c:712
#: src/main/options.c:723
msgid ""
"cannot use line mode or transfer modifier options when watching file "
"descriptors"
msgstr ""
#: src/main/options.c:721
#: src/main/options.c:732
msgid "cannot use cursor positioning when watching file descriptors"
msgstr ""
#: src/main/options.c:730
#: src/main/options.c:741
msgid "cannot use remote control when watching file descriptors"
msgstr "удалённое управление невозможно при отслеживании дескрипторов файлов"
#: src/main/options.c:739
#: src/main/options.c:750
msgid "cannot transfer files when watching file descriptors"
msgstr "передача файлов невозможна при отслеживании дескрипторов файлов"
#: src/main/options.c:754
#: src/main/options.c:765
msgid "not available on systems without /proc/self/fdinfo"
msgstr "невозможно на системах без /proc/self/fdinfo"
+16 -12
View File
@@ -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-09 23:15+0000\n"
"POT-Creation-Date: 2024-12-10 22:03+0000\n"
"PO-Revision-Date: 2024-10-12 23:51+0000\n"
"Last-Translator: a-j-wood <a-j-wood@users.noreply.translate.codeberg.org>\n"
"Language-Team: Turkish <https://translate.codeberg.org/projects/pv/pv/tr/>\n"
@@ -310,33 +310,37 @@ msgstr "seçenek yapısı tahsisi başarısız oldu"
msgid "option structure argv allocation failed"
msgstr "seçenek yapısı argv tahsisi başarısız oldu"
#: src/main/options.c:425
#: src/main/options.c:416
msgid "numeric value not understood"
msgstr ""
#: src/main/options.c:435
msgid "integer argument expected"
msgstr "tamsayı bağımsız değişkeni bekleniyor"
#: src/main/options.c:436
#: src/main/options.c:447
msgid "numeric argument expected"
msgstr "sayısal bağımsız değişken bekleniyor"
#: src/main/options.c:447
#: src/main/options.c:458
msgid "process ID or pid:fd pair expected"
msgstr "süreç kimliği (ID) veya pid:fd çifti bekleniyor"
#: src/main/options.c:454
#: src/main/options.c:465
msgid "invalid process ID"
msgstr "geçersiz süreç kimliği (ID)"
#: src/main/options.c:679
#: src/main/options.c:690
#, c-format
msgid "Try `%s --help' for more information."
msgstr "Daha fazla bilgi için `%s --help' seçeneğini deneyin."
#: src/main/options.c:681
#: src/main/options.c:692
#, c-format
msgid "Try `%s -h' for more information."
msgstr "Daha fazla bilgi için `%s -h' seçeneğini deneyin."
#: src/main/options.c:712
#: src/main/options.c:723
msgid ""
"cannot use line mode or transfer modifier options when watching file "
"descriptors"
@@ -344,19 +348,19 @@ msgstr ""
"dosya tanımlayıcılarını izlerken satır modu veya aktarım değiştirici "
"seçeneklerini kullanamaz"
#: src/main/options.c:721
#: src/main/options.c:732
msgid "cannot use cursor positioning when watching file descriptors"
msgstr "dosya tanımlayıcılarını izlerken imleç konumlandırmayı kullanamaz"
#: src/main/options.c:730
#: src/main/options.c:741
msgid "cannot use remote control when watching file descriptors"
msgstr "dosya tanımlayıcılarını izlerken uzaktan kumandayı kullanamaz"
#: src/main/options.c:739
#: src/main/options.c:750
msgid "cannot transfer files when watching file descriptors"
msgstr "dosya tanımlayıcıları izlenirken dosya aktarılamıyor"
#: src/main/options.c:754
#: src/main/options.c:765
msgid "not available on systems without /proc/self/fdinfo"
msgstr "/proc/self/fdinfo olmayan sistemlerde kullanılamaz"
+3 -2
View File
@@ -45,8 +45,9 @@ typedef struct pvstate_s *pvstate_t;
* Valid number types for pv_getnum_check().
*/
typedef enum {
PV_NUMTYPE_INTEGER,
PV_NUMTYPE_DOUBLE
PV_NUMTYPE_ANY_WITH_SUFFIX,
PV_NUMTYPE_BARE_INTEGER,
PV_NUMTYPE_BARE_DOUBLE
} pv_numtype;
+20 -9
View File
@@ -405,24 +405,34 @@ opts_t opts_parse(unsigned int argc, char **argv)
break;
/* falls through */
/*@fallthrough@ */
case 'L':
/*@fallthrough@ */
case 'B':
/*@fallthrough@ */
case 'Z':
if (!pv_getnum_check(optarg, PV_NUMTYPE_ANY_WITH_SUFFIX)) {
/*@-mustfreefresh@ *//* see above */
fprintf(stderr, "%s: -%c: %s: %s\n", opts->program_name, c, optarg,
_("numeric value not understood"));
opts_free(opts);
return NULL;
/*@+mustfreefresh@ */
}
break;
case 'A':
/*@fallthrough@ */
case 'w':
/*@fallthrough@ */
case 'H':
/*@fallthrough@ */
case 'L':
/*@fallthrough@ */
case 'B':
/*@fallthrough@ */
case 'R':
/*@fallthrough@ */
case 'm':
/*@fallthrough@ */
case 'Z':
if (!pv_getnum_check(optarg, PV_NUMTYPE_INTEGER)) {
if (!pv_getnum_check(optarg, PV_NUMTYPE_BARE_INTEGER)) {
/*@-mustfreefresh@ *//* see above */
fprintf(stderr, "%s: -%c: %s\n", opts->program_name, c, _("integer argument expected"));
fprintf(stderr, "%s: -%c: %s: %s\n", opts->program_name, c, optarg,
_("integer argument expected"));
opts_free(opts);
return NULL;
/*@+mustfreefresh@ */
@@ -431,9 +441,10 @@ opts_t opts_parse(unsigned int argc, char **argv)
case 'i':
/*@fallthrough@ */
case 'D':
if (!pv_getnum_check(optarg, PV_NUMTYPE_DOUBLE)) {
if (!pv_getnum_check(optarg, PV_NUMTYPE_BARE_DOUBLE)) {
/*@-mustfreefresh@ *//* see above */
fprintf(stderr, "%s: -%c: %s\n", opts->program_name, c, _("numeric argument expected"));
fprintf(stderr, "%s: -%c: %s: %s\n", opts->program_name, c, optarg,
_("numeric argument expected"));
opts_free(opts);
return NULL;
/*@+mustfreefresh@ */
+19 -16
View File
@@ -37,21 +37,22 @@ off_t pv_getnum_size(const char *str, bool decimal_units)
unsigned int fractional_divisor = 1;
unsigned int binary_shift = 0;
off_t decimal_multiplier = 0;
size_t readpos = 0;
if (NULL == str)
return (off_t) 0;
/* Skip any non-numeric leading characters. */
while (str[0] != '\0' && (!pv_isdigit(str[0])))
str++;
while (str[readpos] != '\0' && (!pv_isdigit(str[readpos])))
readpos++;
/*
* Parse the integral part of the number - the digits before the
* decimal mark or units.
*/
for (; pv_isdigit(str[0]); str++) {
for (; pv_isdigit(str[readpos]); readpos++) {
integral_part = integral_part * 10;
integral_part += (off_t) (str[0] - '0');
integral_part += (off_t) (str[readpos] - '0');
}
/*
@@ -62,13 +63,13 @@ off_t pv_getnum_size(const char *str, bool decimal_units)
* will fail if there are any locales whose decimal mark is not one
* of those two characters.
*/
if (('.' == str[0]) || (',' == str[0])) {
str++;
for (; pv_isdigit(str[0]); str++) {
if (('.' == str[readpos]) || (',' == str[readpos])) {
readpos++;
for (; pv_isdigit(str[readpos]); readpos++) {
/* Stop counting below 0.0001. */
if (fractional_divisor < 10000) {
fractional_part = fractional_part * 10;
fractional_part += (off_t) (str[0] - '0');
fractional_part += (off_t) (str[readpos] - '0');
fractional_divisor = fractional_divisor * 10;
}
}
@@ -78,11 +79,11 @@ off_t pv_getnum_size(const char *str, bool decimal_units)
* Parse any units given (K=KiB=*1024, M=MiB=1024KiB, G=GiB=1024MiB,
* T=TiB=1024GiB; replace 1024 with 1000 if decimal_units is true).
*/
if (str[0] != '\0') {
if (str[readpos] != '\0') {
/* Skip any spaces or tabs after the digits. */
while ((' ' == str[0]) || ('\t' == str[0]))
str++;
switch (str[0]) {
while ((' ' == str[readpos]) || ('\t' == str[readpos]))
readpos++;
switch (str[readpos]) {
case 'k':
case 'K':
binary_shift = 10;
@@ -159,6 +160,8 @@ off_t pv_getnum_size(const char *str, bool decimal_units)
fractional_part = fractional_part / fractional_divisor;
integral_part += fractional_part;
debug("%s [%s] = %ld", str, decimal_units ? "decimal" : "binary", integral_part);
return integral_part;
}
@@ -237,8 +240,8 @@ bool pv_getnum_check(const char *str, pv_numtype type)
* check that too.
*/
if (('.' == str[0]) || (',' == str[0])) {
/* Integers should have no decimal mark. */
if (type == PV_NUMTYPE_INTEGER)
/* Bare integers should have no decimal mark. */
if (type == PV_NUMTYPE_BARE_INTEGER)
return false;
/* Skip the decimal mark, then all digits. */
str++;
@@ -249,8 +252,8 @@ bool pv_getnum_check(const char *str, pv_numtype type)
if ('\0' == str[0])
return true;
/* A units suffix is not allowed for doubles, only for integers. */
if (type == PV_NUMTYPE_DOUBLE)
/* A units suffix is only allowed for ANY_WITH_SUFFIX. */
if (type != PV_NUMTYPE_ANY_WITH_SUFFIX)
return false;
/* Skip trailing spaces or tabs. */