From: David Ahern Date: Fri, 9 Feb 2018 16:04:39 +0000 (-0800) Subject: Merge branch 'unify_tunnel_help' into next X-Git-Tag: v4.17.0~87 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e7548462e286f9823a23405ff84244ab07a3e6e;p=thirdparty%2Fiproute2.git Merge branch 'unify_tunnel_help' into next Serhey Popovych says: ==================== To show only relevant diffs of ip and ipv6 variants help message print routines needs to be unified and improved. Get rid of print_usage() and usage() wrappers: use single function to output help message. As side effect we return -1 from parse function instead of calling exit(2) in case of "... tunnel " is found. Additionally we get pointer to @struct link_util and can directly access ->id information to prepare customized help message. Split calls to fprintf() two group: one that contains format string with specifiers (thus requiring parameters) and another one that does not. This helps compiler to optimize calls to fprintf() with fputs() when no format specifiers in string. Do not use fputs() directly to keep code formatting nice. After this series applied following diffs: # diff -urN ip/link_gre{,6}.c # diff -urN ip/link_vti{,6}.c # diff -urN ip/link_ip{,6}tnl.c in scope of help print routines reduced to necessary minimum. Tested minimally by compiling and executing "ip link help " and "ip link add type help" commands. Looks correct. See individual patch description for more information. Reviews, commands and suggestions are welcome. ==================== Signed-off-by: David Ahern --- 8e7548462e286f9823a23405ff84244ab07a3e6e