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 <polluks@sdf.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Stefan Haubenthal
2025-11-26 20:02:16 +00:00
committed by Christian Brabandt
parent efa3b1f86d
commit 40699e3990
2 changed files with 24 additions and 21 deletions

View File

@ -729,6 +729,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1928,
/**/
1927,
/**/

View 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);
}