* 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)
*
# 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
{
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);
}