aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/usage.h3
-rw-r--r--util-linux/hexdump.c6
2 files changed, 7 insertions, 2 deletions
diff --git a/include/usage.h b/include/usage.h
index ab0bb4ce4..912a88f4e 100644
--- a/include/usage.h
+++ b/include/usage.h
@@ -1087,13 +1087,14 @@
1087 "daemon:x:1:1:daemon:/usr/sbin:/bin/sh\n" 1087 "daemon:x:1:1:daemon:/usr/sbin:/bin/sh\n"
1088 1088
1089#define hexdump_trivial_usage \ 1089#define hexdump_trivial_usage \
1090 "[-[bcdefnosvx]] [OPTION] FILE" 1090 "[-[bcCdefnosvx]] [OPTION] FILE"
1091#define hexdump_full_usage \ 1091#define hexdump_full_usage \
1092 "The hexdump utility is a filter which displays the specified files,\n" \ 1092 "The hexdump utility is a filter which displays the specified files,\n" \
1093 "or the standard input, if no files are specified, in a user specified\n" \ 1093 "or the standard input, if no files are specified, in a user specified\n" \
1094 "format\n" \ 1094 "format\n" \
1095 "\t-b\t\tOne-byte octal display\n" \ 1095 "\t-b\t\tOne-byte octal display\n" \
1096 "\t-c\t\tOne-byte character display\n" \ 1096 "\t-c\t\tOne-byte character display\n" \
1097 "\t-C\t\tCanonical hex+ASCII, 16 bytes per line\n" \
1097 "\t-d\t\tTwo-byte decimal display\n" \ 1098 "\t-d\t\tTwo-byte decimal display\n" \
1098 "\t-e FORMAT STRING\n" \ 1099 "\t-e FORMAT STRING\n" \
1099 "\t-f FORMAT FILE\n" \ 1100 "\t-f FORMAT FILE\n" \
diff --git a/util-linux/hexdump.c b/util-linux/hexdump.c
index 1858b08d4..e2cbcaf89 100644
--- a/util-linux/hexdump.c
+++ b/util-linux/hexdump.c
@@ -57,7 +57,7 @@ static const char * const add_strings[] = {
57 57
58static const char add_first[] = "\"%07.7_Ax\n\""; 58static const char add_first[] = "\"%07.7_Ax\n\"";
59 59
60static const char hexdump_opts[] = "bcdoxe:f:n:s:v"; 60static const char hexdump_opts[] = "bcdoxCe:f:n:s:v";
61 61
62static const struct suffix_mult suffixes[] = { 62static const struct suffix_mult suffixes[] = {
63 {"b", 512 }, 63 {"b", 512 },
@@ -80,6 +80,10 @@ int hexdump_main(int argc, char **argv)
80 if ((p - hexdump_opts) < 5) { 80 if ((p - hexdump_opts) < 5) {
81 bb_dump_add(add_first); 81 bb_dump_add(add_first);
82 bb_dump_add(add_strings[(int)(p - hexdump_opts)]); 82 bb_dump_add(add_strings[(int)(p - hexdump_opts)]);
83 } else if (ch == 'C') {
84 bb_dump_add("\"%08.8_Ax\n\"");
85 bb_dump_add("\"%08.8_ax \" 8/1 \"%02x \" \" \" 8/1 \"%02x \" ");
86 bb_dump_add("\" |\" 16/1 \"%_p\" \"|\\n\"");
83 } else { 87 } else {
84 /* Sae a little bit of space below by omitting the 'else's. */ 88 /* Sae a little bit of space below by omitting the 'else's. */
85 if (ch == 'e') { 89 if (ch == 'e') {