@@ -11,21 +11,28 @@ import (
1111
1212var completionsTool = & complete.Command {
1313 Sub : map [string ]* complete.Command {
14- "aggregate" : completionsToolAggregate ,
15- "next" : completionsToolNext ,
16- "prev" : completionsToolPrev ,
17- "is_v4" : completionsToolIsV4 ,
18- "is_v6" : completionsToolIsV6 ,
19- "is_valid" : completionsToolIsValid ,
20- "is_one_ip" : completionsToolIsOneIp ,
21- "unmap" : completionsToolUnmap ,
22- "lower" : completionsToolLower ,
23- "upper" : completionsToolUpper ,
24- "is_v4in6" : completionsToolIs4In6 ,
25- "ip2n" : completionsToolIP2n ,
26- "n2ip" : completionsToolN2IP ,
27- "n2ip6" : completionsToolN2IP6 ,
28- "prefix" : completionsToolPrefix ,
14+ "aggregate" : completionsToolAggregate ,
15+ "next" : completionsToolNext ,
16+ "prev" : completionsToolPrev ,
17+ "is_v4" : completionsToolIsV4 ,
18+ "is_v6" : completionsToolIsV6 ,
19+ "is_valid" : completionsToolIsValid ,
20+ "is_one_ip" : completionsToolIsOneIp ,
21+ "unmap" : completionsToolUnmap ,
22+ "lower" : completionsToolLower ,
23+ "upper" : completionsToolUpper ,
24+ "is_v4in6" : completionsToolIs4In6 ,
25+ "ip2n" : completionsToolIP2n ,
26+ "n2ip" : completionsToolN2IP ,
27+ "n2ip6" : completionsToolN2IP6 ,
28+ "prefix" : completionsToolPrefix ,
29+ "is_loopback" : completionsToolIsLoopBack ,
30+ "is_multicast" : completionsToolIsMulticast ,
31+ "is_unspecified" : completionsToolIsUnspecified ,
32+ "is_global_unicast" : completionsToolIsGlobalUnicast ,
33+ "is_link_local_unicast" : completionsToolIsLinkLocalUnicast ,
34+ "is_link_local_multicast" : completionsToolIsLinkLocalMulticast ,
35+ "is_interface_local_multicast" : completionsToolIsInterfaceLocalMulticast ,
2936 },
3037 Flags : map [string ]complete.Predictor {
3138 "-h" : predict .Nothing ,
@@ -39,21 +46,28 @@ func printHelpTool() {
3946 `Usage: %s tool <cmd> [<opts>] [<args>]
4047
4148Commands:
42- aggregate aggregate IPs, IP ranges, and CIDRs.
43- next get the next IP of the input IP
44- prev get the previous IP of the input IP
45- is_v4 reports whether input is an IPv4 address.
46- is_v6 reports whether input is an IPv6 address.
47- is_valid reports whether an IP is valid.
48- is_one_ip checks whether a CIDR or IP Range contains exactly one IP.
49- unmap returns ip with any IPv4-mapped IPv6 address prefix removed.
50- lower get start IP of IPs, IP ranges, and CIDRs.
51- upper get end IP of IPs, IP ranges, and CIDRs.
52- is_v4in6 get whether the IP is an IPv4-mapped IPv6 address.
53- ip2n converts an IPv4 or IPv6 address to its decimal representation.
54- n2ip evaluates a mathematical expression and converts it to an IPv4 or IPv6.
55- n2ip6 evaluates a mathematical expression and converts it to an IPv6.
56- prefix misc. prefix tools related to CIDRs.
49+ aggregate aggregate IPs, IP ranges, and CIDRs.
50+ next get the next IP of the input IP
51+ prev get the previous IP of the input IP
52+ is_v4 reports whether input is an IPv4 address.
53+ is_v6 reports whether input is an IPv6 address.
54+ is_valid reports whether an IP is valid.
55+ is_one_ip checks whether a CIDR or IP Range contains exactly one IP.
56+ unmap returns ip with any IPv4-mapped IPv6 address prefix removed.
57+ lower get start IP of IPs, IP ranges, and CIDRs.
58+ upper get end IP of IPs, IP ranges, and CIDRs.
59+ is_v4in6 get whether the IP is an IPv4-mapped IPv6 address.
60+ ip2n converts an IPv4 or IPv6 address to its decimal representation.
61+ n2ip evaluates a mathematical expression and converts it to an IPv4 or IPv6.
62+ n2ip6 evaluates a mathematical expression and converts it to an IPv6.
63+ prefix misc. prefix tools related to CIDRs.
64+ is_loopback reports whether an IP is a valid loopback address.
65+ is_multicast reports whether an IP is a valid multicast address.
66+ is_unspecified reports whether an IP is an unspecified address.
67+ is_global_unicast reports whether an IP is a global unicast address.
68+ is_link_local_unicast reports whether IP is a link local unicast.
69+ is_link_local_multicast reports whether IP is a link local multicast address.
70+ is_interface_local_multicast reports whether IP is an interface local multicast.
5771
5872Options:
5973 --help, -h
@@ -112,6 +126,20 @@ func cmdTool() error {
112126 err = cmdToolN2IP6 ()
113127 case cmd == "prefix" :
114128 err = cmdToolPrefix ()
129+ case cmd == "is_loopback" :
130+ err = cmdToolIsLoopBack ()
131+ case cmd == "is_multicast" :
132+ err = cmdToolIsMultiCast ()
133+ case cmd == "is_unspecified" :
134+ err = cmdToolIsUnspecified ()
135+ case cmd == "is_global_unicast" :
136+ err = cmdToolisGlobalUnicast ()
137+ case cmd == "is_link_local_unicast" :
138+ err = cmdToolIsLinkLocalUnicast ()
139+ case cmd == "is_link_local_multicast" :
140+ err = cmdToolIsLinkLocalMulticast ()
141+ case cmd == "is_interface_local_multicast" :
142+ err = cmdToolIsInterfaceLocalMulticast ()
115143 default :
116144 err = toolHelp ()
117145 }
0 commit comments