]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1928: xxd: exit_with_usage() can be simplified v9.1.1928
authorStefan Haubenthal <polluks@sdf.org>
Wed, 26 Nov 2025 20:02:16 +0000 (20:02 +0000)
committerChristian Brabandt <cb@256bit.org>
Wed, 26 Nov 2025 20:02:16 +0000 (20:02 +0000)
Problem:  xxd: exit_with_usage() can be simplified
Solution: Clean up exit_with_usage() formatting slightly
          (Stefan Haubenthal)

closes: #18813

Signed-off-by: Stefan Haubenthal <polluks@sdf.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/version.c
src/xxd/xxd.c

index 1c0186ccbdadffe57e75341a4ed4d2820ae5242c..8210130ee7ffac06d3f39479bc60802876a55eab 100644 (file)
@@ -729,6 +729,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1928,
 /**/
     1927,
 /**/
index b46cee41f0be353db34cbdd82eba1776f7dda9c7..ddc11ee96b9e3ee7638b694ed73d36db962a461e 100644 (file)
@@ -71,6 +71,7 @@
  * 08.08.2025  fix overflow with bitwise output
  * 20.08.2025  remove external library call for autoconversion on z/OS (MVS)
  * 24.08.2025  avoid NULL dereference with autoskip colorless
+ * 26.11.2025  update indent in exit_with_usage()
  *
  * (c) 1990-1998 by Juergen Weigert (jnweiger@gmail.com)
  *
@@ -151,7 +152,7 @@ extern void perror __P((char *));
 # endif
 #endif
 
-char version[] = "xxd 2025-08-24 by Juergen Weigert et al.";
+char version[] = "xxd 2025-11-26 by Juergen Weigert et al.";
 #ifdef WIN32
 char osver[] = " (Win32)";
 #else
@@ -274,32 +275,32 @@ exit_with_usage(void)
 {
   fprintf(stderr, "Usage:\n       %s [options] [infile [outfile]]\n", pname);
   fprintf(stderr, "    or\n       %s -r [-s [-]offset] [-c cols] [-ps] [infile [outfile]]\n", pname);
-  fprintf(stderr, "Options:\n");
-  fprintf(stderr, "    -a          toggle autoskip: A single '*' replaces nul-lines. Default off.\n");
-  fprintf(stderr, "    -b          binary digit dump (incompatible with -ps). Default hex.\n");
-  fprintf(stderr, "    -C          capitalize variable names in C include file style (-i).\n");
-  fprintf(stderr, "    -c cols     format <cols> octets per line. Default 16 (-i: 12, -ps: 30).\n");
-  fprintf(stderr, "    -E          show characters in EBCDIC. Default ASCII.\n");
-  fprintf(stderr, "    -e          little-endian dump (incompatible with -ps,-i,-r).\n");
-  fprintf(stderr, "    -g bytes    number of octets per group in normal output. Default 2 (-e: 4).\n");
-  fprintf(stderr, "    -h          print this summary.\n");
-  fprintf(stderr, "    -i          output in C include file style.\n");
-  fprintf(stderr, "    -l len      stop after <len> octets.\n");
-  fprintf(stderr, "    -n name     set the variable name used in C include output (-i).\n");
-  fprintf(stderr, "    -o off      add <off> to the displayed file position.\n");
-  fprintf(stderr, "    -ps         output in postscript plain hexdump style.\n");
-  fprintf(stderr, "    -r          reverse operation: convert (or patch) hexdump into binary.\n");
-  fprintf(stderr, "    -r -s off   revert with <off> added to file positions found in hexdump.\n");
-  fprintf(stderr, "    -d          show offset in decimal instead of hex.\n");
+  fprintf(stderr, "Options:\n"
+                 "    -a          toggle autoskip: A single '*' replaces nul-lines. Default off.\n"
+                 "    -b          binary digit dump (incompatible with -ps). Default hex.\n"
+                 "    -C          capitalize variable names in C include file style (-i).\n"
+                 "    -c cols     format <cols> octets per line. Default 16 (-i: 12, -ps: 30).\n"
+                 "    -E          show characters in EBCDIC. Default ASCII.\n"
+                 "    -e          little-endian dump (incompatible with -ps,-i,-r).\n"
+                 "    -g bytes    number of octets per group in normal output. Default 2 (-e: 4).\n"
+                 "    -h          print this summary.\n"
+                 "    -i          output in C include file style.\n"
+                 "    -l len      stop after <len> octets.\n"
+                 "    -n name     set the variable name used in C include output (-i).\n"
+                 "    -o off      add <off> to the displayed file position.\n"
+                 "    -ps         output in postscript plain hexdump style.\n"
+                 "    -r          reverse operation: convert (or patch) hexdump into binary.\n"
+                 "    -r -s off   revert with <off> added to file positions found in hexdump.\n"
+                 "    -d          show offset in decimal instead of hex.\n");
   fprintf(stderr, "    -s %sseek  start at <seek> bytes abs. %sinfile offset.\n",
 #ifdef TRY_SEEK
          "[+][-]", "(or +: rel.) ");
 #else
          "", "");
 #endif
-  fprintf(stderr, "    -u          use upper case hex letters.\n");
-  fprintf(stderr, "    -R when     colorize the output; <when> can be 'always', 'auto' or 'never'. Default: 'auto'.\n"),
-  fprintf(stderr, "    -v          show version: \"%s%s\".\n", version, osver);
+  fprintf(stderr, "    -u          use upper case hex letters.\n"
+                 "    -R when     colorize the output; <when> can be 'always', 'auto' or 'never'. Default: 'auto'.\n"
+                 "    -v          show version: \"%s%s\".\n", version, osver);
   exit(1);
 }