When invoking hexdump as hd enable the "Canonical" format to by
default, implying the -C option.
This is historic behaviour on Debian and apparently also on FreeBSD.
Some Debian users have asked for this to be restored, after Debian
switched to util-linux' hexdump and hd.
Signed-off-by: Chris Hofstaedtler <zeha@debian.org>
Let's add "Arguments:" section to the --help output and describe
{K,M,G...}iB suffixes there.
Addresses: https://github.com/karelzak/util-linux/pull/917
Co-Author: ed <ed@s5h.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
changed in include/c.h and applied via sed:
sed -i 's/fprintf.*\(USAGE_MAN_TAIL.*\)/printf(\1/' $(git ls-files -- "*.c")
sed -i 's/print_usage_help_options\(.*\);/printf(USAGE_HELP_OPTIONS\1);/' $(git ls-files -- "*.c")
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Consolidate --help and --version descriptions. We are
now able to align them to the other options.
We changed include/c.h. The rest of this patch was
generated by sed, plus manually setting the right
alignment numbers. We do not change anything but
white spaces in the --help output.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
This patch is trivial and changes nothing, because
we were always using usage(stdout)
Now all our usage() functions look very similar. If wanted we
could auto-generate another big cosmetical patch to remove all
the useless "FILE *out" constants and use printf and puts
rather than their f* friends. Such patch could be automatically
synchronized with the translation project (newlines!) to not
make the translators sick.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
As documented in the manual and the usage info, the long options
--one-byte-char, --canonical, and --two-bytes-octal should not accept
any arguments.
Signed-off-by: Phil Ruffwind <rf@rufflewind.com>
This adds a concise description of a tool to its usage text.
A first form of this patch was proposed by Steven Honeyman
(see http://www.spinics.net/lists/util-linux-ng/msg09994.html).
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Message 'calling hexdump as od has been deprecated in favor of GNU
coreutils od' has informed the hexdump not to be used like that for three
and half years, and five releases. It is time to get rid of notice.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
[kzak@redhat.com: - move paths to pathnames.h,
- use static path buffer]
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
[kzak@redhat.com: - fix coding style,
- use xalloc in all code,
- fix strtol usage]
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
The change f2a037fb7b had unfavorable
effect of making hexdump to return non-zero exit value always.
This happen because oversight when 'exitval' gets to be set. By clance,
one might expect main() to call next() which will return value for
'exitval'. That assessment misses later call chain main() -> display()
-> get() -> next(), which in reverse should return correct value for
'exitval'.
It was mentioned in util-linux maillist that Ondrej Oprala is working on
major renewal of the hexdump . That in mind it seems best to simply to
revert the global 'exitval' and avoid conflict with Ondrej's work.
Reference: http://markmail.org/message/sbnvuhkboreujj5p
Reported-by: Dave Reisner <d@falconindy.com>
CC: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
text-utils/hexdump.h:84:5: warning: shadowed declaration is here [-Wshadow]
./include/xalloc.h:23:28: warning: declaration of 'size' shadows a global declaration [-Wshadow]
./include/xalloc.h:33:40: warning: declaration of 'size' shadows a global declaration [-Wshadow]
./include/xalloc.h:43:49: warning: declaration of 'size' shadows a global declaration [-Wshadow]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
display.c: In function ‘get’:
display.c:262:117: warning: comparison of distinct pointer types lacks
a cast [enabled by default]
Signed-off-by: Karel Zak <kzak@redhat.com>
strtosize() is based on uintmax_t and supports all possible suffixes
(B,M,G,T ...)
Reported-by: Simon de Vlieger <simon@ikanobori.jp>
Signed-off-by: Karel Zak <kzak@redhat.com>
New usage help screen and print version switch. Also fixes to
exit codes, util linux xmalloc replaced emalloc and every error
print is using libc error function.
[kzak@redhat.com: - minor changes in formatting and coding style]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>