More refactoring & polishing.

Do not call usage() without telling why.

Extract '-a' mode into a function, and sanitize hexdumping.

Revise manpage to match reality of code.
This commit is contained in:
Poul-Henning Kamp 2021-05-12 21:37:00 +00:00
parent 5ab41ff8e9
commit 29c6e6e279

View File

@ -79,7 +79,7 @@ usage(const char *msg)
if (msg != NULL)
fprintf(stderr, "%s\n", msg);
fprintf(stderr, "usage: %s -a addr [-f device] [-d [r|w]] [-o offset] "
"[-w [0|8|16]] [-c count] [-m [tr|ss|rs|no]] [-b] [-v]\n",
"[-w [0|8|16|16LE|16BE]] [-c count] [-m [tr|ss|rs|no]] [-b] [-v]\n",
getprogname());
fprintf(stderr, " %s -s [-f device] [-n skip_addr] -v\n",
getprogname());