patch 9.0.1998: xxd: cannot reverse a bit dump
Problem: xxd: cannot reverse a bit dump
Solution: implement reversing the bit dump using -b -r
closes: #13286
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: tristhaus <tristhaus@yahoo.de>
diff --git a/runtime/doc/xxd-fr.1 b/runtime/doc/xxd-fr.1
index e170df5..7aa3ff1 100644
--- a/runtime/doc/xxd-fr.1
+++ b/runtime/doc/xxd-fr.1
@@ -70,7 +70,7 @@
Cette option écrit les octets comme une séquence de "1" et de "0" au lieu
d'une conversion en hexadécimal traditionnel. Chaque ligne est précédée par un
numéro de ligne en hexadécimal et suivie de la représentation ASCII (ou
-EBCDIC) correspondante. Les options \-r, \-p, \-i ne fonctionnent pas dans ce
+EBCDIC) correspondante. Les options \-p, \-i ne fonctionnent pas dans ce
mode.
.TP
.IR "\-c cols " | " \-cols cols"
diff --git a/runtime/doc/xxd-fr.UTF-8.1 b/runtime/doc/xxd-fr.UTF-8.1
index 47773a1..9c4c4c9 100644
--- a/runtime/doc/xxd-fr.UTF-8.1
+++ b/runtime/doc/xxd-fr.UTF-8.1
@@ -70,7 +70,7 @@
Cette option écrit les octets comme une séquence de "1" et de "0" au lieu
d'une conversion en hexadécimal traditionnel. Chaque ligne est précédée par un
numéro de ligne en hexadécimal et suivie de la représentation ASCII (ou
-EBCDIC) correspondante. Les options \-r, \-p, \-i ne fonctionnent pas dans ce
+EBCDIC) correspondante. Les options \-p, \-i ne fonctionnent pas dans ce
mode.
.TP
.IR "\-c cols " | " \-cols cols"
diff --git a/runtime/doc/xxd-it.1 b/runtime/doc/xxd-it.1
index 9034fdd..ed4fd81 100644
--- a/runtime/doc/xxd-it.1
+++ b/runtime/doc/xxd-it.1
@@ -63,7 +63,7 @@
Richiesta di un'immagine binaria (cifre binarie), invece che esadecimale.
Quest'opzione scrive un byte come otto cifre "1" e "0" invece di usare i
numeri esadecimali. Ogni riga è preceduta da un indirizzo in esadecimale e
-seguita da una decodifica ASCII (o EBCDIC). Le opzioni \-r, \-p, \-i,
+seguita da una decodifica ASCII (o EBCDIC). Le opzioni \-p, \-i,
specificabili dalla riga comando, non funzionano in questo modo.
.TP
.IR "\-c colonne " | " \-cols colonne"
diff --git a/runtime/doc/xxd-it.UTF-8.1 b/runtime/doc/xxd-it.UTF-8.1
index b982a2c..8653de9 100644
--- a/runtime/doc/xxd-it.UTF-8.1
+++ b/runtime/doc/xxd-it.UTF-8.1
@@ -63,7 +63,7 @@
Richiesta di un'immagine binaria (cifre binarie), invece che esadecimale.
Quest'opzione scrive un byte come otto cifre "1" e "0" invece di usare i
numeri esadecimali. Ogni riga è preceduta da un indirizzo in esadecimale e
-seguita da una decodifica ASCII (o EBCDIC). Le opzioni \-r, \-p, \-i,
+seguita da una decodifica ASCII (o EBCDIC). Le opzioni \-p, \-i,
specificabili dalla riga comando, non funzionano in questo modo.
.TP
.IR "\-c colonne " | " \-cols colonne"
diff --git a/runtime/doc/xxd-ja.UTF-8.1 b/runtime/doc/xxd-ja.UTF-8.1
index a03671c..1e06bde 100644
--- a/runtime/doc/xxd-ja.UTF-8.1
+++ b/runtime/doc/xxd-ja.UTF-8.1
@@ -58,7 +58,7 @@
1 オクテットが "1" と "0" の 8 文字で出力されます。
各行の行頭には 16 進数の行番号が表示されます。
行末には ascii (または ebcdic) で表した場合の文字が表示されます。
-このモードでは \-r、\-p、\-i は機能しません。
+このモードでは \-p、\-i は機能しません。
.TP
.IR \-e
リトルエンディアンの 16 進ダンプに切り替える。
diff --git a/runtime/doc/xxd-pl.1 b/runtime/doc/xxd-pl.1
index d9fa9be..877b7e4 100644
--- a/runtime/doc/xxd-pl.1
+++ b/runtime/doc/xxd-pl.1
@@ -66,7 +66,7 @@
Opcja ta zapisuje oktety jako osiem cyfr 1 lub 0 zamiast normalnego
zrzutu heksowego. Ka¿da linia jest poprzedzona przez
heksadecymalny numer linii a po nim jego reprezentacj± w ascii (lub
-ebcdic). Opcje linii poleceñ \-r, \-p, \-i nie dzia³aj± w tym
+ebcdic). Opcje linii poleceñ \-p, \-i nie dzia³aj± w tym
trybie.
.TP
.IR "\-c cols " | " \-cols cols"
diff --git a/runtime/doc/xxd-pl.UTF-8.1 b/runtime/doc/xxd-pl.UTF-8.1
index e63ce64..a28dd63 100644
--- a/runtime/doc/xxd-pl.UTF-8.1
+++ b/runtime/doc/xxd-pl.UTF-8.1
@@ -66,7 +66,7 @@
Opcja ta zapisuje oktety jako osiem cyfr 1 lub 0 zamiast normalnego
zrzutu heksowego. Każda linia jest poprzedzona przez
heksadecymalny numer linii a po nim jego reprezentacją w ascii (lub
-ebcdic). Opcje linii poleceń \-r, \-p, \-i nie działają w tym
+ebcdic). Opcje linii poleceń \-p, \-i nie działają w tym
trybie.
.TP
.IR "\-c cols " | " \-cols cols"
diff --git a/runtime/doc/xxd-ru.1 b/runtime/doc/xxd-ru.1
index 111946a..8f32432 100644
--- a/runtime/doc/xxd-ru.1
+++ b/runtime/doc/xxd-ru.1
@@ -70,7 +70,7 @@
ðÒÉ ÉÓÐÏÌØÚÏ×ÁÎÉÉ ÜÔÏÇÏ ËÌÀÞÁ ×ÍÅÓÔÏ ÏÂÙÞÎÏÇÏ ÛÅÓÔÎÁÄÃÁÔÅÒÉÞÎÏÇÏ ÐÒÅÄÓÔÁ×ÌÅÎÉÑ
ÏËÔÅÔÏ× ÉÓÐÏÌØÚÕÀÔÓÑ ÎÁÂÏÒÙ ÉÚ ×ÏÓØÍÉ ÓÉÍ×ÏÌÏ× "1" É "0". ëÁÖÄÁÑ ÓÔÒÏËÁ
ÐÒÅÄ×ÁÒÑÅÔÓÑ ÎÏÍÅÒÏÍ ÓÔÒÏËÉ × ÛÅÓÔÎÁÄÃÁÔÅÒÉÞÎÏÍ ×ÉÄÅ, Á ÚÁ×ÅÒÛÁÅÔÓÑ ÓÉÍ×ÏÌØÎÙÍ
-ÐÒÅÄÓÔÁ×ÌÅÎÉÅÍ (× ×ÉÄÅ ascii ÉÌÉ ebcdic). ëÌÀÞÉ \-r, \-p, \-i × ÜÔÏÍ ÒÅÖÉÍÅ
+ÐÒÅÄÓÔÁ×ÌÅÎÉÅÍ (× ×ÉÄÅ ascii ÉÌÉ ebcdic). ëÌÀÞÉ \-p, \-i × ÜÔÏÍ ÒÅÖÉÍÅ
ÎÅ ÒÁÂÏÔÁÀÔ.
.TP
.IR "\-c ËÏÌ " | " \-cols ËÏÌ"
diff --git a/runtime/doc/xxd-ru.UTF-8.1 b/runtime/doc/xxd-ru.UTF-8.1
index 647845b..4a41d66 100644
--- a/runtime/doc/xxd-ru.UTF-8.1
+++ b/runtime/doc/xxd-ru.UTF-8.1
@@ -70,7 +70,7 @@
При использовании этого ключа вместо обычного шестнадцатеричного представления
октетов используются наборы из восьми символов "1" и "0". Каждая строка
предваряется номером строки в шестнадцатеричном виде, а завершается символьным
-представлением (в виде ascii или ebcdic). Ключи \-r, \-p, \-i в этом режиме
+представлением (в виде ascii или ebcdic). Ключи \-p, \-i в этом режиме
не работают.
.TP
.IR "\-c кол " | " \-cols кол"
diff --git a/runtime/doc/xxd.1 b/runtime/doc/xxd.1
index 7cd6ae8..f5a7c65 100644
--- a/runtime/doc/xxd.1
+++ b/runtime/doc/xxd.1
@@ -64,7 +64,7 @@
This option writes octets as eight digits "1"s and "0"s instead of a normal
hexadecimal dump. Each line is preceded by a line number in hexadecimal and
followed by an ASCII (or EBCDIC) representation. The command line switches
-\-r, \-p, \-i do not work with this mode.
+\-p, \-i do not work with this mode.
.TP
.IR "\-c cols " | " \-cols cols"
Format
@@ -133,7 +133,9 @@
.I \-r \-p
to read plain hexadecimal dumps without line number information and without a
particular column layout. Additional whitespace and line breaks are allowed
-anywhere.
+anywhere. Use the combination
+.I \-r \-b
+to read a bits dump instead of a hex dump.
.TP
.IR \-R " " when
In output the hex-value and the value are both colored with the same color
diff --git a/runtime/doc/xxd.man b/runtime/doc/xxd.man
index 06cc784..56b69b4 100644
--- a/runtime/doc/xxd.man
+++ b/runtime/doc/xxd.man
@@ -37,7 +37,7 @@
option writes octets as eight digits "1"s and "0"s instead of a
normal hexadecimal dump. Each line is preceded by a line number
in hexadecimal and followed by an ASCII (or EBCDIC) representa‐
- tion. The command line switches -r, -p, -i do not work with this
+ tion. The command line switches -p, -i do not work with this
mode.
-c cols | -cols cols
@@ -97,7 +97,8 @@
truncating it. Use the combination -r -p to read plain hexadeci‐
mal dumps without line number information and without a particu‐
lar column layout. Additional whitespace and line breaks are al‐
- lowed anywhere.
+ lowed anywhere. Use the combination -r -b to read a bits dump
+ instead of a hex dump.
-R when
In output the hex-value and the value are both colored with the