tls: reorder a few more cipher ids
[oweals/busybox.git] / util-linux / hexdump_xxd.c
index cc34ea64971ac1f09862832d2b64791677bd369e..6cf6d029789f6e2bdd2415035c9a6d15c22ccb54 100644 (file)
@@ -7,11 +7,11 @@
  * Licensed under GPLv2, see file LICENSE in this source tree.
  */
 //config:config XXD
-//config:      bool "xxd"
+//config:      bool "xxd (8.9 kb)"
 //config:      default y
 //config:      help
-//config:        The xxd utility is used to display binary data in a readable
-//config:        way that is comparable to the output from most hex editors.
+//config:      The xxd utility is used to display binary data in a readable
+//config:      way that is comparable to the output from most hex editors.
 
 //applet:IF_XXD(APPLET_NOEXEC(xxd, xxd, BB_DIR_USR_BIN, BB_SUID_DROP, xxd))
 
@@ -73,8 +73,9 @@ int xxd_main(int argc UNUSED_PARAM, char **argv)
 #define OPT_s (1 << 1)
 #define OPT_a (1 << 2)
 #define OPT_p (1 << 3)
-       opt_complementary = "?1"; /* 1 argument max */
-       opt = getopt32(argv, "l:s:apg:+c:+", &opt_l, &opt_s, &bytes, &cols);
+       opt = getopt32(argv, "^" "l:s:apg:+c:+" "\0" "?1" /* 1 argument max */,
+                       &opt_l, &opt_s, &bytes, &cols
+       );
        argv += optind;
 
        dumper->dump_vflag = ALL;
@@ -129,7 +130,7 @@ int xxd_main(int argc UNUSED_PARAM, char **argv)
                }
                // for -g3, this results in B B BS B B BS... B = "xxxxxx xxxxxx .....xx"
                // todo: can be more clever and use
-               // one "cols-1/B" format instead of many "B B B..." formats
+               // one 'bytes-1/1 "%02x"' format instead of many "B B B..." formats
                //bb_error_msg("ADDED:'%s'", bigbuf);
                bb_dump_add(dumper, bigbuf);
                free(bigbuf);
@@ -138,6 +139,8 @@ int xxd_main(int argc UNUSED_PARAM, char **argv)
        if (!(opt & OPT_p)) {
                sprintf(buf, "\"  \"%u/1 \"%%_p\"\"\n\"", cols); // "  ASCII\n"
                bb_dump_add(dumper, buf);
+       } else {
+               bb_dump_add(dumper, "\"\n\"");
        }
 
        return bb_dump_dump(dumper, argv);