mirror of
https://github.com/sheumann/hush.git
synced 2025-02-28 20:31:33 +00:00
support GNU suffixes for fancy mode: b(512), k(1024) and m(1024*1024)
This commit is contained in:
parent
b1fd52e0b7
commit
e75b41d990
@ -25,6 +25,15 @@ static const char head_opts[] =
|
|||||||
#endif
|
#endif
|
||||||
;
|
;
|
||||||
|
|
||||||
|
#if ENABLE_FEATURE_FANCY_HEAD
|
||||||
|
static const struct suffix_mult head_suffixes[] = {
|
||||||
|
{ "b", 512 },
|
||||||
|
{ "k", 1024 },
|
||||||
|
{ "m", 1024*1024 },
|
||||||
|
{ NULL, 0 }
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
static const char header_fmt_str[] = "\n==> %s <==\n";
|
static const char header_fmt_str[] = "\n==> %s <==\n";
|
||||||
|
|
||||||
int head_main(int argc, char **argv)
|
int head_main(int argc, char **argv)
|
||||||
@ -75,7 +84,14 @@ int head_main(int argc, char **argv)
|
|||||||
#if !ENABLE_DEBUG_YANK_SUSv2 || ENABLE_FEATURE_FANCY_HEAD
|
#if !ENABLE_DEBUG_YANK_SUSv2 || ENABLE_FEATURE_FANCY_HEAD
|
||||||
GET_COUNT:
|
GET_COUNT:
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !ENABLE_FEATURE_FANCY_HEAD
|
||||||
count = bb_xgetularg10(p);
|
count = bb_xgetularg10(p);
|
||||||
|
#else
|
||||||
|
count = bb_xgetularg_bnd_sfx(p, 10,
|
||||||
|
0, ULONG_MAX,
|
||||||
|
head_suffixes);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
bb_show_usage();
|
bb_show_usage();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user