From 677ec86cef983a106c6e5d175f44b125858c3016 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 19 Dec 2016 13:13:34 +0100 Subject: Use --help suggestion on invalid option The current default is to print all usage() output. This is overkill in many case. Addresses: https://github.com/karelzak/util-linux/issues/338 Signed-off-by: Karel Zak --- include/c.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/c.h b/include/c.h index bf11d61ac..3f47dbdcb 100644 --- a/include/c.h +++ b/include/c.h @@ -212,6 +212,12 @@ errmsg(char doexit, int excode, char adderr, const char *fmt, ...) exit(eval); \ }) +#define errtryh(eval) __extension__ ({ \ + fprintf(stderr, _("Try '%s -h' for more information.\n"), \ + program_invocation_short_name); \ + exit(eval); \ +}) + static inline __attribute__((const)) int is_power_of_2(unsigned long num) { -- cgit v1.2.3-55-g7522