fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
a53db7256
master
1# localization: skip(private) 2function __fish_print_addresses --description"List own network addresses with interface as description" 3# if --all is given, also print 0.0.0.0 and :: 4if contains -- --all$argv 5echo -e"0.0.0.0\tall" 6echo -e"::\tall" 7end 8if command -sq ip 9command ip --oneline address| string replace -r'^\d+:\s+(\S+)\s+inet6?\s+([^\s/]+).*' '$2\t$1' 10else if command -sq ifconfig 11# This is for OSX/BSD 12# There's also linux ifconfig but that has at least two different output formats 13# is basically dead, and ip is installed on everything now 14ifconfig | awk '/^\tinet/ { print $2 } ' 15end 16end