fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
566a673e4
master
1complete -c ping -xa"(__fish_print_hostnames)" 2 3set -l ping_version( ping -V2>&1 | string collect) 4 5switch $ping_version 6case '*iputils*' 7# completions for ping from iputils 8complete -c ping -s4 -d"Use IPv4" 9complete -c ping -s6 -d"Use IPv6" 10complete -c ping -s a -d"Audible ping" 11complete -c ping -s A -d"Adaptive ping" 12complete -c ping -s b -d"Allow pinging a broadcast address (IPv4 only)" 13complete -c ping -s B -d"Sticky source address" 14complete -c ping -s c -d"Stop after specified number of packets" -x 15complete -c ping -s D -d"Print timestamps" 16complete -c ping -s d -d"Set SO_DEBUG socket option" 17complete -c ping -s f -d"Flood ping" 18complete -c ping -s F -d"Define flow label (IPv6 only)" -x 19complete -c ping -s h -d"Print help and exit" 20complete -c ping -s I -d"Set source address to specified interface address" -xa"(__fish_print_interfaces; __fish_print_addresses)" 21complete -c ping -s i -d"Seconds between sending each packet" -x 22complete -c ping -s L -d"Suppress loopback of multicast packets" 23complete -c ping -s l -d"Send the specified number of packets without waiting for reply" -x 24complete -c ping -s m -d"Tag the packets going out" -x 25complete -c ping -s M -d"Select Path MTU Discovery strategy" -xa"do want dont" 26complete -c ping -s n -d"No dns name resolution" 27complete -c ping -s N -d"Send ICMPv6 Node Information Queries (IPv6 only)" -x 28complete -c ping -s O -d"Report outstanding replies" 29complete -c ping -s p -d"Contents of padding byte" -x 30complete -c ping -s R -d"Record route (IPv4 only)" 31complete -c ping -s q -d"Quiet mode" 32complete -c ping -s Q -d"Set QoS bits in ICMP datagrams" -x 33complete -c ping -s s -d"Number of data bytes to be sent" -x 34complete -c ping -s S -d"Set socket buffer size" -x 35complete -c ping -s t -d"Set the IP Time to Live" -x 36complete -c ping -s T -d"Set IP timestamp options (IPv4 only)" -xa"tsonly tsandaddr tsprespec" 37complete -c ping -s U -d"Print full user-to-user latency" 38complete -c ping -s v -d"Verbose mode" 39complete -c ping -s V -d"Display version and exit" 40complete -c ping -s w -d"Specify a timeout, in seconds, before ping exits" -x 41complete -c ping -s W -d"Time to wait for a response, in seconds" -x 42 43case '*inetutils*' 44# completions for ping from GNU inetutils 45complete -c ping -l address -l mask -d"Send ICMP_ADDRESS packets" 46complete -c ping -l echo -d"Send ICMP_ECHO packets" 47complete -c ping -l timestamp -d"Send ICMP_TIMESTAMP packets" 48complete -c ping -s t -l type -d"Set packet type" -x 49complete -c ping -s c -l count -d"Set number of packets to send" -x 50complete -c ping -s d -l debug -d"Set the SO_DEBUG option" 51complete -c ping -s i -l interval -d"Set seconds to wait between sending each packet" -x 52complete -c ping -s n -l numeric -d"Do not resolve host addresses" 53complete -c ping -s r -l ignore-routing -d"Send directly to a host on an attached network" 54complete -c ping -l ttl -d"Set time-to-live" -x 55complete -c ping -s T -l tos -d"Set type of service" -x 56complete -c ping -s v -l verbose -d"Verbose output" 57complete -c ping -s w -l timeout -d"Stop after N seconds" -x 58complete -c ping -s W -l linger -d"Number of seconds to wait for response" -x 59complete -c ping -s f -l flood -d"Flood ping" 60complete -c ping -l ip-timestamp -d"Set IP timestamp type" -xa"tsonly tsaddr" 61complete -c ping -s l -l preload -d"Send number of packets as fast as possible" -x 62complete -c ping -s p -l pattern -d"Fill ICMP packet with given pattern" -x 63complete -c ping -s q -l quiet -d"Quiet output" 64complete -c ping -s R -l route -d"Record route" 65complete -c ping -s s -l size -d"Set number of data octets" -x 66complete -c ping -s\? -l help -d"Show help" 67complete -c ping -l usage -d"Short usage message" 68complete -c ping -s V -l version -d"Print program version" 69 70case '*BusyBox*' 71# completions for ping from busybox 72complete -c ping -s4 -d"Use IPv4" 73complete -c ping -s6 -d"Use IPv6" 74complete -c ping -s c -d"Set number of pings to send" -x 75complete -c ping -s s -d"Set data size" -x 76complete -c ping -s i -d"Interval (seconds)" -x 77complete -c ping -s A -d"Ping as soon as reply is received" 78complete -c ping -s t -d"Set TTL" -x 79complete -c ping -s I -d"Source interface or IP address" -xa"(__fish_print_interfaces; __fish_print_addresses)" 80complete -c ping -s W -d"Seconds to wait for the first response" -x 81complete -c ping -s w -d"Seconds until ping exits" -x 82complete -c ping -s q -d Quiet 83complete -c ping -s p -d"Payload pattern" -x 84 85case '*' 86set -l ping_os_version( uname ) 87switch $ping_os_version 88case '*FreeBSD*' '*Darwin*' 89# In common with FreeBSD and Apple 90complete -c ping -s A -d"Audible ping" 91complete -c ping -s a -d"Audible ping" 92complete -c ping -s C -d"Prohibit the socket from using the cellular network interface" 93complete -c ping -s c -d"Stop after specified number of packets" -x 94complete -c ping -s D -d"Set the Don't Fragment bit" 95complete -c ping -s d -d"Set the SO_DEBUG socket option" 96complete -c ping -s f -d"Flood ping" 97complete -c ping -s G -d"Maximum payload size for sweeping pings" -x 98complete -c ping -s g -d"Minimum payload size for sweeping pings" -x 99complete -c ping -s h -d"Payload size increment for sweeping pings" -x 100complete -c ping -s I -d"Source multicast packets with the given interface address" -x 101complete -c ping -s i -d"Seconds between sending each packet" -x 102complete -c ping -s L -d"Suppress loopback of multicast packets" 103complete -c ping -s l -d"Send specified number of packets as fast as possible" -x 104complete -c ping -s M -d"Use ICMP_MASKREQ or ICMP_TSTAMP instead of ICMP_ECHO" -xa"mask time" 105complete -c ping -s m -d"Time To Live for outgoing packets" -x 106complete -c ping -s n -d"Numeric output only" 107complete -c ping -s o -d"Exit successfully after receiving one reply packet" 108complete -c ping -s P -d"Specify IPsec policy for the ping session" -x 109complete -c ping -s p -d"Pattern to fill the sent packets" -x 110complete -c ping -s Q -d"Somewhat quiet output" 111complete -c ping -s q -d"Quiet output" 112complete -c ping -s R -d"Record route" 113complete -c ping -s r -d"Bypass the normal routing tables" 114complete -c ping -s S -d"Source address for outgoing packets" -xa"(__fish_print_addresses)" 115complete -c ping -s s -d"The number of data bytes to be sent" -x 116complete -c ping -s T -d"Time To Live for multicasted packets" -x 117complete -c ping -s t -d"Timeout (seconds) before ping exits" -x 118complete -c ping -s v -d"Verbose output" 119complete -c ping -s W -d"Time (milliseconds) to wait for a reply for each packet sent" -x 120complete -c ping -s z -d"Use the specified type of service" -x 121 122if string match -q'*Darwin*' $ping_os_version 123# Apple specific 124complete -c ping -s b -d"Bind the socket to specified interface for sending" -xa"(__fish_print_interfaces)" 125complete -c ping -s k -d"Traffic class to use for sending ICMP packets" -xa"BK_SYS BK BE RD OAM AV RV VI VO CTL" 126complete -c ping -s K -d"Network service type to use for sending ICMP packets" -xa"BK_SYS BK BE RV AV RD OAM VI SIG VO" 127complete -c ping -l apple-connect -d"Connects the socket to the destination address" 128complete -c ping -l apple-time -d"Prints the time a packet was received" 129end 130end 131end