This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
Re: [Patch] regtool: Add load/unload commands and --binary option
Igor Peshansky wrote:
> What if you want to redirect the hex dump to a file? IMO, isatty() checks
> are only useful if the output won't change qualitatively on redirection
> (e.g., for coloring). Otherwise, it's always better to use an explicit
> flag.
Good point. Why don't we just emulate the behavior of 'cat' here? If
isatty() is true and non-ascii characters are in the output, then prompt
first before possibly fubaring the user's terminal, otherwise just
output the raw data.
And just as 'cat' does not have any internal code for formatting binary
data as a hex dump, neither should regtool, since 'od' works perfectly
for that and already has the veritable kitchen sink of formatting
options.
Brian