Skip to content

Commit 40699e3

Browse files
Stefan Haubenthalchrisbra
authored andcommitted
patch 9.1.1928: xxd: exit_with_usage() can be simplified
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 <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent efa3b1f commit 40699e3

File tree

2 files changed

+24
-21
lines changed

2 files changed

+24
-21
lines changed

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,8 @@ static char *(features[]) =
729729

730730
static int included_patches[] =
731731
{ /* Add new patch number below this line */
732+
/**/
733+
1928,
732734
/**/
733735
1927,
734736
/**/

src/xxd/xxd.c

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
* 08.08.2025 fix overflow with bitwise output
7272
* 20.08.2025 remove external library call for autoconversion on z/OS (MVS)
7373
* 24.08.2025 avoid NULL dereference with autoskip colorless
74+
* 26.11.2025 update indent in exit_with_usage()
7475
*
7576
* (c) 1990-1998 by Juergen Weigert ([email protected])
7677
*
@@ -151,7 +152,7 @@ extern void perror __P((char *));
151152
# endif
152153
#endif
153154

154-
char version[] = "xxd 2025-08-24 by Juergen Weigert et al.";
155+
char version[] = "xxd 2025-11-26 by Juergen Weigert et al.";
155156
#ifdef WIN32
156157
char osver[] = " (Win32)";
157158
#else
@@ -274,32 +275,32 @@ exit_with_usage(void)
274275
{
275276
fprintf(stderr, "Usage:\n %s [options] [infile [outfile]]\n", pname);
276277
fprintf(stderr, " or\n %s -r [-s [-]offset] [-c cols] [-ps] [infile [outfile]]\n", pname);
277-
fprintf(stderr, "Options:\n");
278-
fprintf(stderr, " -a toggle autoskip: A single '*' replaces nul-lines. Default off.\n");
279-
fprintf(stderr, " -b binary digit dump (incompatible with -ps). Default hex.\n");
280-
fprintf(stderr, " -C capitalize variable names in C include file style (-i).\n");
281-
fprintf(stderr, " -c cols format <cols> octets per line. Default 16 (-i: 12, -ps: 30).\n");
282-
fprintf(stderr, " -E show characters in EBCDIC. Default ASCII.\n");
283-
fprintf(stderr, " -e little-endian dump (incompatible with -ps,-i,-r).\n");
284-
fprintf(stderr, " -g bytes number of octets per group in normal output. Default 2 (-e: 4).\n");
285-
fprintf(stderr, " -h print this summary.\n");
286-
fprintf(stderr, " -i output in C include file style.\n");
287-
fprintf(stderr, " -l len stop after <len> octets.\n");
288-
fprintf(stderr, " -n name set the variable name used in C include output (-i).\n");
289-
fprintf(stderr, " -o off add <off> to the displayed file position.\n");
290-
fprintf(stderr, " -ps output in postscript plain hexdump style.\n");
291-
fprintf(stderr, " -r reverse operation: convert (or patch) hexdump into binary.\n");
292-
fprintf(stderr, " -r -s off revert with <off> added to file positions found in hexdump.\n");
293-
fprintf(stderr, " -d show offset in decimal instead of hex.\n");
278+
fprintf(stderr, "Options:\n"
279+
" -a toggle autoskip: A single '*' replaces nul-lines. Default off.\n"
280+
" -b binary digit dump (incompatible with -ps). Default hex.\n"
281+
" -C capitalize variable names in C include file style (-i).\n"
282+
" -c cols format <cols> octets per line. Default 16 (-i: 12, -ps: 30).\n"
283+
" -E show characters in EBCDIC. Default ASCII.\n"
284+
" -e little-endian dump (incompatible with -ps,-i,-r).\n"
285+
" -g bytes number of octets per group in normal output. Default 2 (-e: 4).\n"
286+
" -h print this summary.\n"
287+
" -i output in C include file style.\n"
288+
" -l len stop after <len> octets.\n"
289+
" -n name set the variable name used in C include output (-i).\n"
290+
" -o off add <off> to the displayed file position.\n"
291+
" -ps output in postscript plain hexdump style.\n"
292+
" -r reverse operation: convert (or patch) hexdump into binary.\n"
293+
" -r -s off revert with <off> added to file positions found in hexdump.\n"
294+
" -d show offset in decimal instead of hex.\n");
294295
fprintf(stderr, " -s %sseek start at <seek> bytes abs. %sinfile offset.\n",
295296
#ifdef TRY_SEEK
296297
"[+][-]", "(or +: rel.) ");
297298
#else
298299
"", "");
299300
#endif
300-
fprintf(stderr, " -u use upper case hex letters.\n");
301-
fprintf(stderr, " -R when colorize the output; <when> can be 'always', 'auto' or 'never'. Default: 'auto'.\n"),
302-
fprintf(stderr, " -v show version: \"%s%s\".\n", version, osver);
301+
fprintf(stderr, " -u use upper case hex letters.\n"
302+
" -R when colorize the output; <when> can be 'always', 'auto' or 'never'. Default: 'auto'.\n"
303+
" -v show version: \"%s%s\".\n", version, osver);
303304
exit(1);
304305
}
305306

0 commit comments

Comments
 (0)