From: Stephen Hemminger Date: Thu, 18 Mar 2021 00:14:13 +0000 (-0700) Subject: ip: cleanup help message text X-Git-Tag: v5.12.0~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6639fce4308980b7b64eb9cfab0e2748bce1b908;p=thirdparty%2Fiproute2.git ip: cleanup help message text Wrap help message text at 80 characters, and put list of things in alpha order. Signed-off-by: Stephen Hemminger --- diff --git a/ip/ip.c b/ip/ip.c index 40d2998ae..c561c01f6 100644 --- a/ip/ip.c +++ b/ip/ip.c @@ -64,10 +64,11 @@ static void usage(void) fprintf(stderr, "Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }\n" " ip [ -force ] -batch filename\n" - "where OBJECT := { link | address | addrlabel | route | rule | neigh | ntable |\n" - " tunnel | tuntap | maddress | mroute | mrule | monitor | xfrm |\n" - " netns | l2tp | fou | macsec | tcp_metrics | token | netconf | ila |\n" - " vrf | sr | nexthop | mptcp }\n" + "where OBJECT := { address | addrlabel | fou | help | ila | l2tp | link |\n" + " macsec | maddress | monitor | mptcp | mroute | mrule |\n" + " neighbor | neighbour | netconf | netns | nexthop | ntable |\n" + " ntbl | route | rule | sr | tap | tcpmetrics |\n" + " token | tunnel | tuntap | vrf | xfrm }\n" " OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |\n" " -h[uman-readable] | -iec | -j[son] | -p[retty] |\n" " -f[amily] { inet | inet6 | mpls | bridge | link } |\n" diff --git a/ip/ip_common.h b/ip/ip_common.h index 9a31e8375..1fd2ed3a2 100644 --- a/ip/ip_common.h +++ b/ip/ip_common.h @@ -39,6 +39,7 @@ int print_neigh(struct nlmsghdr *n, void *arg); int ipaddr_list_link(int argc, char **argv); void ipaddr_get_vf_rate(int, int *, int *, const char *); void iplink_usage(void) __attribute__((noreturn)); +void iplink_types_usage(void); void iproute_reset_filter(int ifindex); void ipmroute_reset_filter(int ifindex); diff --git a/ip/ipaddress.c b/ip/ipaddress.c index 0bbcee2b3..cfb24f5c1 100644 --- a/ip/ipaddress.c +++ b/ip/ipaddress.c @@ -73,12 +73,8 @@ static void usage(void) "CONFFLAG-LIST := [ CONFFLAG-LIST ] CONFFLAG\n" "CONFFLAG := [ home | nodad | mngtmpaddr | noprefixroute | autojoin ]\n" "LIFETIME := [ valid_lft LFT ] [ preferred_lft LFT ]\n" - "LFT := forever | SECONDS\n" - "TYPE := { vlan | veth | vcan | vxcan | dummy | ifb | macvlan | macvtap |\n" - " bridge | bond | ipoib | ip6tnl | ipip | sit | vxlan | lowpan |\n" - " gre | gretap | erspan | ip6gre | ip6gretap | ip6erspan | vti |\n" - " nlmon | can | bond_slave | ipvlan | geneve | bridge_slave |\n" - " hsr | macsec | netdevsim }\n"); + "LFT := forever | SECONDS\n"); + iplink_types_usage(); exit(-1); } diff --git a/ip/ipila.c b/ip/ipila.c index 739ee4e1a..475c35b5c 100644 --- a/ip/ipila.c +++ b/ip/ipila.c @@ -31,7 +31,8 @@ static void usage(void) "Usage: ip ila add loc_match LOCATOR_MATCH loc LOCATOR [ dev DEV ] OPTIONS\n" " ip ila del loc_match LOCATOR_MATCH [ loc LOCATOR ] [ dev DEV ]\n" " ip ila list\n" - "OPTIONS := [ csum-mode { adj-transport | neutral-map | neutral-map-auto | no-action } ]\n" + "OPTIONS := [ csum-mode { adj-transport | neutral-map |\n" + " neutral-map-auto | no-action } ]\n" " [ ident-type { luid | use-format } ]\n"); exit(-1); diff --git a/ip/iplink.c b/ip/iplink.c index 27c9be442..faafd7e89 100644 --- a/ip/iplink.c +++ b/ip/iplink.c @@ -46,6 +46,19 @@ static void usage(void) __attribute__((noreturn)); static int iplink_have_newlink(void); +void iplink_types_usage(void) +{ + /* Remember to add new entry here if new type is added. */ + fprintf(stderr, + "TYPE := { bareudp | bond | bond_slave | bridge | bridge_slave |\n" + " dummy | erspan | geneve | gre | gretap | ifb |\n" + " ip6erspan | ip6gre | ip6gretap | ip6tnl |\n" + " ipip | ipoib | ipvlan | ipvtap |\n" + " macsec | macvlan | macvtap |\n" + " netdevsim | nlmon | rmnet | sit | team | team_slave |\n" + " vcan | veth | vlan | vrf | vti | vxcan | vxlan | xfrm }\n"); +} + void iplink_usage(void) { if (iplink_have_newlink()) { @@ -117,13 +130,8 @@ void iplink_usage(void) fprintf(stderr, "\n" " ip link help [ TYPE ]\n" - "\n" - "TYPE := { vlan | veth | vcan | vxcan | dummy | ifb | macvlan | macvtap |\n" - " bridge | bond | team | ipoib | ip6tnl | ipip | sit | vxlan |\n" - " gre | gretap | erspan | ip6gre | ip6gretap | ip6erspan |\n" - " vti | nlmon | team_slave | bond_slave | bridge_slave |\n" - " ipvlan | ipvtap | geneve | bareudp | vrf | macsec | netdevsim | rmnet |\n" - " xfrm }\n"); + "\n"); + iplink_types_usage(); } exit(-1); } diff --git a/ip/ipmonitor.c b/ip/ipmonitor.c index 99f5fda8b..50aa013ee 100644 --- a/ip/ipmonitor.c +++ b/ip/ipmonitor.c @@ -30,9 +30,10 @@ int listen_all_nsid; static void usage(void) { fprintf(stderr, - "Usage: ip monitor [ all | LISTofOBJECTS ] [ FILE ] [ label ] [all-nsid] [dev DEVICE]\n" - "LISTofOBJECTS := link | address | route | mroute | prefix |\n" - " neigh | netconf | rule | nsid | nexthop\n" + "Usage: ip monitor [ all | OBJECTS ] [ FILE ] [ label ] [ all-nsid ]\n" + " [ dev DEVICE ]\n" + "OBJECTS := address | link | mroute | neigh | netconf |\n" + " nexthop | nsid | prefix | route | rule\n" "FILE := file FILENAME\n"); exit(-1); } diff --git a/ip/ipneigh.c b/ip/ipneigh.c index 678b40341..2d6b7f587 100644 --- a/ip/ipneigh.c +++ b/ip/ipneigh.c @@ -50,15 +50,15 @@ static void usage(void) { fprintf(stderr, "Usage: ip neigh { add | del | change | replace }\n" - " { ADDR [ lladdr LLADDR ] [ nud STATE ] | proxy ADDR } [ dev DEV ]\n" - " [ router ] [ extern_learn ] [ protocol PROTO ]\n" + " { ADDR [ lladdr LLADDR ] [ nud STATE ] proxy ADDR }\n" + " [ dev DEV ] [ router ] [ extern_learn ] [ protocol PROTO ]\n" "\n" " ip neigh { show | flush } [ proxy ] [ to PREFIX ] [ dev DEV ] [ nud STATE ]\n" " [ vrf NAME ]\n" " ip neigh get { ADDR | proxy ADDR } dev DEV\n" "\n" - "STATE := { permanent | noarp | stale | reachable | none |\n" - " incomplete | delay | probe | failed }\n"); + "STATE := { delay | failed | incomplete | noarp | none |\n" + " permanent | probe | reachable | stale }\n"); exit(-1); } diff --git a/ip/iprule.c b/ip/iprule.c index 9f5d998b7..4166073c0 100644 --- a/ip/iprule.c +++ b/ip/iprule.c @@ -44,7 +44,8 @@ static void usage(void) "Usage: ip rule { add | del } SELECTOR ACTION\n" " ip rule { flush | save | restore }\n" " ip rule [ list [ SELECTOR ]]\n" - "SELECTOR := [ not ] [ from PREFIX ] [ to PREFIX ] [ tos TOS ] [ fwmark FWMARK[/MASK] ]\n" + "SELECTOR := [ not ] [ from PREFIX ] [ to PREFIX ] [ tos TOS ]\n" + " [ fwmark FWMARK[/MASK] ]\n" " [ iif STRING ] [ oif STRING ] [ pref NUMBER ] [ l3mdev ]\n" " [ uidrange NUMBER-NUMBER ]\n" " [ ipproto PROTOCOL ]\n" diff --git a/ip/iptunnel.c b/ip/iptunnel.c index 696f3b92b..2369ee062 100644 --- a/ip/iptunnel.c +++ b/ip/iptunnel.c @@ -34,7 +34,8 @@ static void usage(void) { fprintf(stderr, "Usage: ip tunnel { add | change | del | show | prl | 6rd } [ NAME ]\n" - " [ mode { ipip | gre | sit | isatap | vti } ] [ remote ADDR ] [ local ADDR ]\n" + " [ mode { gre | ipip | isatap | sit | vti } ]\n" + " [ remote ADDR ] [ local ADDR ]\n" " [ [i|o]seq ] [ [i|o]key KEY ] [ [i|o]csum ]\n" " [ prl-default ADDR ] [ prl-nodefault ADDR ] [ prl-delete ADDR ]\n" " [ 6rd-prefix ADDR ] [ 6rd-relay_prefix ADDR ] [ 6rd-reset ]\n"