]> git.proxmox.com Git - mirror_iproute2.git/commit
treewide: refactor help messages
authorMatteo Croce <mcroce@redhat.com>
Fri, 17 May 2019 13:38:28 +0000 (15:38 +0200)
committerDavid Ahern <dsahern@gmail.com>
Mon, 20 May 2019 21:35:07 +0000 (14:35 -0700)
commit8589eb4efdf2a6ba047ac193307695fc39133911
tree1c10f13ba927dd939513ae4d3f7673c2c105b833
parent2cc9b5f4fa2d01659d95175643939fddb324c5e8
treewide: refactor help messages

Every tool in the iproute2 package have one or more function to show
an help message to the user. Some of these functions print the help
line by line with a series of printf call, e.g. ip/xfrm_state.c does
60 fprintf calls.
If we group all the calls to a single one and just concatenate strings,
we save a lot of libc calls and thus object size. The size difference
of the compiled binaries calculated with bloat-o-meter is:

        ip/ip:
        add/remove: 0/0 grow/shrink: 5/15 up/down: 103/-4796 (-4693)
        Total: Before=672591, After=667898, chg -0.70%
        ip/rtmon:
        add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-54 (-54)
        Total: Before=48879, After=48825, chg -0.11%
        tc/tc:
        add/remove: 0/2 grow/shrink: 31/10 up/down: 882/-6133 (-5251)
        Total: Before=351912, After=346661, chg -1.49%
        bridge/bridge:
        add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-459 (-459)
        Total: Before=70502, After=70043, chg -0.65%
        misc/lnstat:
        add/remove: 0/1 grow/shrink: 1/0 up/down: 48/-486 (-438)
        Total: Before=9960, After=9522, chg -4.40%
        tipc/tipc:
        add/remove: 0/0 grow/shrink: 1/1 up/down: 18/-62 (-44)
        Total: Before=79182, After=79138, chg -0.06%

While at it, indent some strings which were starting at column 0,
and use tabs where possible, to have a consistent style across helps.

Signed-off-by: Matteo Croce <mcroce@redhat.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
83 files changed:
bridge/link.c
bridge/mdb.c
ip/ip.c
ip/ip6tunnel.c
ip/ipaddress.c
ip/ipaddrlabel.c
ip/ipila.c
ip/iplink.c
ip/iplink_bridge.c
ip/iplink_bridge_slave.c
ip/iplink_geneve.c
ip/iplink_hsr.c
ip/iplink_ipoib.c
ip/iplink_vlan.c
ip/iplink_vxlan.c
ip/ipmaddr.c
ip/ipmonitor.c
ip/ipmroute.c
ip/ipneigh.c
ip/ipnetns.c
ip/ipntable.c
ip/ipseg6.c
ip/iptunnel.c
ip/iptuntap.c
ip/ipvrf.c
ip/link_gre.c
ip/link_gre6.c
ip/link_ip6tnl.c
ip/link_iptnl.c
ip/link_vti.c
ip/link_vti6.c
ip/link_xfrm.c
ip/rtmon.c
ip/tcp_metrics.c
ip/xfrm_monitor.c
ip/xfrm_policy.c
ip/xfrm_state.c
misc/lnstat.c
misc/nstat.c
tc/e_bpf.c
tc/f_basic.c
tc/f_bpf.c
tc/f_flow.c
tc/f_flower.c
tc/f_fw.c
tc/f_matchall.c
tc/f_route.c
tc/f_rsvp.c
tc/f_tcindex.c
tc/m_action.c
tc/m_bpf.c
tc/m_connmark.c
tc/m_estimator.c
tc/m_gact.c
tc/m_ife.c
tc/m_pedit.c
tc/m_police.c
tc/m_sample.c
tc/m_simple.c
tc/m_tunnel_key.c
tc/q_atm.c
tc/q_cake.c
tc/q_cbq.c
tc/q_cbs.c
tc/q_choke.c
tc/q_codel.c
tc/q_etf.c
tc/q_fq.c
tc/q_fq_codel.c
tc/q_gred.c
tc/q_hhf.c
tc/q_mqprio.c
tc/q_netem.c
tc/q_pie.c
tc/q_red.c
tc/q_sfq.c
tc/q_taprio.c
tc/q_tbf.c
tc/tc.c
tc/tc_class.c
tc/tc_exec.c
tc/tc_qdisc.c
tipc/bearer.c